Skip to content

Commit

Permalink
chore: Updates integ tests for compatibility with webdriver upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-kot committed Sep 13, 2024
1 parent f779a5f commit 0f3fab0
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
3 changes: 2 additions & 1 deletion test/e2e/common/table/table-property-filtering-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ export default (setupTest: { (testFn: { (page: TablePropertyFilteringPageObject)
'Allows free-text filtering',
setupTest(async page => {
await page.focusFilter();
await page.search(['bbb', 'Enter']);
await page.search('bbb');
await page.keys(['Enter']);
await expect(page.getFilterText()).resolves.toBe('');
await expect(page.countTokens()).resolves.toBe(1);
})
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/page/s3-page-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ export default class S3PageObject extends BaseExamplePage {
return this.getOptionalText(wrapper.findFormField().findError().toSelector());
}

async setUriInputValue(value: string | string[]) {
async setUriInputValue(value: string) {
await this.setValue(s3ResourceSelector.findInContext().findUriInput().findNativeInput().toSelector(), value);
// click somewhere to blur the input and trigger validation
await this.click(wrapper.findHeader().toSelector());
}

getUriInputValue() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/page/table-property-filtering-page-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class TablePropertyFilteringPageObject extends TablePageObject {
await this.waitUntilLoaded();
}

async search(text: string | string[]) {
async search(text: string) {
await this.setValue(filterInput, text);
await this.waitUntilPropertyFilterLoaded();
}
Expand Down
10 changes: 9 additions & 1 deletion test/e2e/s3-common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ import S3PageObject from './page/s3-page-object';
setupTest(async page => {
await expect(page.getErrorText()).resolves.toEqual(null);
await expect(page.getViewHref()).resolves.toEqual(null);

await page.setUriInputValue('not-a-uri');
// click somewhere to blur the input and trigger validation
await page.click(createWrapper().findHeader().toSelector());
await expect(page.getErrorText()).resolves.toContain('The path must begin with s3://');
await expect(page.getViewHref()).resolves.toEqual(null);
await page.setUriInputValue(['Escape']); // clear the input first

// clear the input first
await page.setUriInputValue('');
await page.keys(['Escape']);
await page.setUriInputValue('s3://bucket-enim/neutrino-8ms.sim');
// click somewhere to blur the input and trigger validation
await page.click(createWrapper().findHeader().toSelector());
await expect(page.getErrorText()).resolves.toEqual(null);
await expect(page.getViewHref()).resolves.toEqual('https://amazons3.demo.s3-resource-selector/test/1');
})
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/s3-read.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ describe('S3 Resource Selector - Read mode', () => {
'shows alert about non-existing objects',
setupTest(async page => {
await page.setUriInputValue('s3://totally/fictional');
// click somewhere to blur the input and trigger validation
await page.click(createWrapper().findHeader().toSelector());
await expect(page.getAlertText()).resolves.toEqual(
'Resource "s3://totally/fictional" cannot be found: "totally" bucket doesn\'t exist'
);

await page.click(s3ResourceSelector.findAlertSlot().findAlert().findDismissButton().toSelector());
await expect(page.getAlertText()).resolves.toEqual(null);
})
Expand All @@ -93,6 +96,8 @@ describe('S3 Resource Selector - Read mode', () => {
'shows alert about missing versions',
setupTest(async page => {
await page.setUriInputValue('s3://bucket-officia/particle-1ns.sim');
// click somewhere to blur the input and trigger validation
await page.click(createWrapper().findHeader().toSelector());
await expect(page.getAlertText()).resolves.toContain(
'You might not have permissions to retrieve object versions.'
);
Expand Down
12 changes: 8 additions & 4 deletions test/e2e/table-saved-filters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ describe('Table - Saved Filters', () => {

// Add a new free text filter
await page.focusFilter();
await page.search(['bbb', 'Enter']);
await page.search('bbb');
await page.keys(['Enter']);

await expect(page.countTokens()).resolves.toBe(3);
await expect(page.getSelectedFilterSet()).resolves.toBe('Active web distributions (unsaved)');
Expand All @@ -66,7 +67,8 @@ describe('Table - Saved Filters', () => {

// Add a new free text filter
await page.focusFilter();
await page.search(['bbb', 'Enter']);
await page.search('bbb');
await page.keys(['Enter']);

await expect(page.countTokens()).resolves.toBe(2);
await expect(page.getSelectedFilterSet()).resolves.toBe('Distributions with buckets (unsaved)');
Expand All @@ -88,7 +90,8 @@ describe('Table - Saved Filters', () => {

// Add a new free text filter
await page.focusFilter();
await page.search(['bbb', 'Enter']);
await page.search('bbb');
await page.keys(['Enter']);

// Save as new filter
await page.openSaveFilterModal();
Expand All @@ -109,7 +112,8 @@ describe('Table - Saved Filters', () => {

// Add a new free text filter
await page.focusFilter();
await page.search(['bbb', 'Enter']);
await page.search('bbb');
await page.keys(['Enter']);

await expect(page.getSelectedFilterSet()).resolves.toBe('Active web distributions (unsaved)');

Expand Down

0 comments on commit 0f3fab0

Please sign in to comment.