Skip to content

Commit

Permalink
FTR: clear browser storage between test suites (#48683)
Browse files Browse the repository at this point in the history
* clear browser storage on test suite completion

* [logstash/pipeline_list] fix tests dependency

* always load new index data
  • Loading branch information
dmlemeshko committed Oct 28, 2019
1 parent d010997 commit d9a5acf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
2 changes: 2 additions & 0 deletions test/functional/services/remote/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export async function RemoteProvider({ getService }: FtrProviderContext) {
.manage()
.window()
.setRect({ width, height });
await driver.executeScript('window.sessionStorage.clear();');
await driver.executeScript('window.localStorage.clear();');
});

lifecycle.on('cleanup', async () => {
Expand Down
16 changes: 4 additions & 12 deletions x-pack/test/functional/apps/logstash/pipeline_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export default function ({ getService, getPageObjects }) {
originalWindowSize = await browser.getWindowSize();
await browser.setWindowSize(1600, 1000);
await esArchiver.load('logstash/example_pipelines');
});

beforeEach(async () => {
await PageObjects.logstash.gotoPipelineList();
});

Expand Down Expand Up @@ -86,10 +89,6 @@ export default function ({ getService, getPageObjects }) {
await pipelineEditor.assertExists();
await pipelineEditor.assertDefaultInputs();
});

after(async () => {
await PageObjects.logstash.gotoPipelineList();
});
});

describe('delete button', () => {
Expand Down Expand Up @@ -122,15 +121,12 @@ export default function ({ getService, getPageObjects }) {

describe('row links', () => {
it('opens the selected row in the editor', async () => {
await PageObjects.logstash.gotoPipelineList();
await pipelineList.setFilter('tweets_and_beats');
await pipelineList.clickFirstRowId();
await pipelineEditor.assertExists();
await pipelineEditor.assertEditorId('tweets_and_beats');
});

after(async () => {
await PageObjects.logstash.gotoPipelineList();
});
});

describe('next page button', () => {
Expand Down Expand Up @@ -225,10 +221,6 @@ export default function ({ getService, getPageObjects }) {
queueCheckpointWrites,
});
});

after(async () => {
await PageObjects.logstash.gotoPipelineList();
});
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function({ getService }: FtrProviderContext) {
describe('multi metric', function() {
this.tags(['smoke', 'mlqa']);
before(async () => {
await esArchiver.loadIfNeeded('ml/farequote');
await esArchiver.load('ml/farequote');
});

after(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function({ getService }: FtrProviderContext) {
describe('population', function() {
this.tags(['smoke', 'mlqa']);
before(async () => {
await esArchiver.loadIfNeeded('ml/ecommerce');
await esArchiver.load('ml/ecommerce');
});

after(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export default function({ getService }: FtrProviderContext) {
describe('saved search', function() {
this.tags(['smoke', 'mlqa']);
before(async () => {
await esArchiver.loadIfNeeded('ml/farequote');
await esArchiver.load('ml/farequote');
});

after(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function({ getService }: FtrProviderContext) {
describe('single metric', function() {
this.tags(['smoke', 'mlqa']);
before(async () => {
await esArchiver.loadIfNeeded('ml/farequote');
await esArchiver.load('ml/farequote');
});

after(async () => {
Expand Down

0 comments on commit d9a5acf

Please sign in to comment.