Skip to content

Instantly share code, notes, and snippets.

@MiguelCastillo
Created October 24, 2016 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiguelCastillo/cb44ee1a9746f7bfc2cb17c4c15fefe1 to your computer and use it in GitHub Desktop.
Save MiguelCastillo/cb44ee1a9746f7bfc2cb17c4c15fefe1 to your computer and use it in GitHub Desktop.
import { expect } from 'chai';
describe('Bad test when awaiting google Suite', () => {
beforeEach(async () => {
await browser.url('https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=bit-bundler');
});
describe('Getting all results container', () => {
var resultWithId, resultText;
beforeEach(async () => {
resultWithId = browser
.waitForExist('[data-hveid="41"]')
.element('[data-hveid="41"]');
// Awaiting here breaks getText
await resultWithId;
resultText = await resultWithId.getText('.r');
});
it('then the text is all good', () => {
expect(resultText).to.equal('bit-bundler-browserpack - npm');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment