Skip to content

Commit

Permalink
[Code] fix history functional test (#37332)
Browse files Browse the repository at this point in the history
* enable history functional test and fix flaky test
  • Loading branch information
WangQianliang authored and WangQianliang committed Jul 3, 2019
1 parent f2dc047 commit a024568
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ class CodeSideTabs extends React.PureComponent<Props> {
return [
{
id: Tabs.file,
name: 'Files',
name: 'File',
content: fileTabContent,
'data-test-subj': 'codeFileTreeTab',
'data-test-subj': `codeFileTreeTab${this.sideTab === Tabs.file ? 'Active' : ''}`,
},
{
id: Tabs.structure,
Expand Down
14 changes: 7 additions & 7 deletions x-pack/test/functional/apps/code/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function manageRepositoriesFunctionalTests({
const PageObjects = getPageObjects(['common', 'header', 'security', 'code', 'home']);

// FLAKY: https://github.com/elastic/kibana/issues/36495
describe.skip('History', () => {
describe('History', () => {
const repositoryListSelector = 'codeRepositoryList codeRepositoryItem';

describe('browser history can go back while exploring code app', () => {
Expand Down Expand Up @@ -224,22 +224,22 @@ export default function manageRepositoriesFunctionalTests({
await PageObjects.common.sleep(5000);
await testSubjects.click('codeStructureTreeTab');
await retry.try(async () => {
const tabText = await (await find.byCssSelector('.euiTab-isSelected')).getVisibleText();
expect(tabText).to.equal('Structure');
// if structure tree tab is active, file tree tab's `data-test-subj` would be `codeFileTreeTab`
expect(testSubjects.exists('codeFileTreeTab')).to.be.ok();
});

await browser.goBack();

await retry.try(async () => {
const tabText = await (await find.byCssSelector('.euiTab-isSelected')).getVisibleText();
expect(tabText).to.equal('File');
// if file tree tab is active, file tree tab's `data-test-subj` would be `codeFileTreeTabActive`
expect(testSubjects.exists('codeFileTreeTabActive')).to.be.ok();
});

await driver.navigate().forward();

await retry.try(async () => {
const tabText = await (await find.byCssSelector('.euiTab-isSelected')).getVisibleText();
expect(tabText).to.equal('Structure');
// if structure tree tab is active, file tree tab's `data-test-subj` would be `codeFileTreeTab`
expect(testSubjects.exists('codeFileTreeTab')).to.be.ok();
});
});
});
Expand Down

0 comments on commit a024568

Please sign in to comment.