Skip to content

Commit

Permalink
minor improvements to the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Aug 17, 2023
1 parent 0ad8250 commit dfb20d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/functional/apps/console/_context_menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
// Ensure that the text area can be interacted with
await PageObjects.console.closeHelpIfExists();
await PageObjects.console.clearTextArea();
await PageObjects.console.enterRequest();
});

it('should open context menu', async () => {
expect(await PageObjects.console.isContextMenuOpen()).to.be(false);
await PageObjects.console.enterRequest();
await PageObjects.console.clickContextMenu();
expect(PageObjects.console.isContextMenuOpen()).to.be.eql(true);
});
Expand Down Expand Up @@ -79,7 +79,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await browser.switchTab(0);
});

it('should auto indent when auto indent button is clicked', async () => {
it('should toggle auto indent when auto indent button is clicked', async () => {
await PageObjects.console.clearTextArea();
await PageObjects.console.enterRequest('GET _search\n{"query": {"match_all": {}}}');
await PageObjects.console.clickContextMenu();
Expand All @@ -89,10 +89,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const request = await PageObjects.console.getRequest();
expect(request).to.be.eql('GET _search\n{\n "query": {\n "match_all": {}\n }\n}');
});
});

it('should condense when auto indent button is clicked again', async () => {
await PageObjects.console.clickContextMenu();
// Click the auto-indent button again to condense request
await PageObjects.console.clickAutoIndentButton();
// Retry until the request is condensed
await retry.try(async () => {
Expand Down

0 comments on commit dfb20d9

Please sign in to comment.