Skip to content

Instantly share code, notes, and snippets.

@Xotabu4
Created September 1, 2016 19:46
Show Gist options
  • Select an option

  • Save Xotabu4/dcfe83bc98ad304f58f3b05de9cd6c69 to your computer and use it in GitHub Desktop.

Select an option

Save Xotabu4/dcfe83bc98ad304f58f3b05de9cd6c69 to your computer and use it in GitHub Desktop.
Own TypeScript example for simple google test with protractor JS
import {browser, element, by, ExpectedConditions as EC} from 'protractor/globals'
describe('google', function () {
beforeEach(function () {
browser.get('/');
});
it('should show correct title after search', function () {
expect(browser.getTitle()).toEqual('Google', 'The page title should be equal "Google" after open');
let searchField = element(by.name('q'));
searchField.sendKeys('Test!');
searchField.submit();
browser.wait(EC.titleContains('Test!'), 10000, 'The page title should start with the searched string after the search.');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment