Skip to content

Commit

Permalink
Console test modified for ES6 conversion (#20048)
Browse files Browse the repository at this point in the history
  • Loading branch information
rashmivkulkarni committed Jun 19, 2018
1 parent 668b719 commit 737b987
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions test/functional/apps/console/_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,29 @@ export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['common', 'console']);

describe('console app', function describeIndexTests() {
before(function () {
before(async function () {
log.debug('navigateTo console');
return PageObjects.common.navigateToApp('console');
await PageObjects.common.navigateToApp('console');
});

it('should show the default *%^$# @ ! ~ request', function () {
it('should show the default *%^$# @ ! ~ request', async function () {
// collapse the help pane because we only get the VISIBLE TEXT, not the part that is scrolled
return PageObjects.console.collapseHelp()
.then(function () {
return retry.try(function () {
return PageObjects.console.getRequest()
.then(function (actualRequest) {
expect(actualRequest.trim()).to.eql(DEFAULT_REQUEST);
});
});
});
await PageObjects.console.collapseHelp();
await retry.try(async function () {
const actualRequest = await PageObjects.console.getRequest();
log.debug(actualRequest);
expect(actualRequest.trim()).to.eql(DEFAULT_REQUEST);
});
});

it('default request response should include `"timed_out": false`', function () {
it('default request response should include `"timed_out": false`', async function () {
const expectedResponseContains = '"timed_out": false,';

return PageObjects.console.clickPlay()
.then(function () {
return retry.try(function () {
return PageObjects.console.getResponse()
.then(function (actualResponse) {
log.debug(actualResponse);
expect(actualResponse).to.contain(expectedResponseContains);
});
});
});
await PageObjects.console.clickPlay();
await retry.try(async function () {
const actualResponse = await PageObjects.console.getResponse();
log.debug(actualResponse);
expect(actualResponse).to.contain(expectedResponseContains);
});
});

it('settings should allow changing the text size', async function () {
Expand Down

0 comments on commit 737b987

Please sign in to comment.