Skip to content

Instantly share code, notes, and snippets.

@ali-kamalizade
Created May 26, 2018 23:26
Show Gist options
  • Save ali-kamalizade/ab75320847a8eac220bf24856560ab11 to your computer and use it in GitHub Desktop.
Save ali-kamalizade/ab75320847a8eac220bf24856560ab11 to your computer and use it in GitHub Desktop.
Sample e2e test with better-protractor
import {} from "protractor";
import {BetterProtractorService} from "better-protractor";
const service: BetterProtractorService = new BetterProtractorService();
describe('Mobiflip', () => {
it('should navigate to Mobiflip page', async() => {
service.disableAngular();
service.navigateToRoute('https://mobiflip.de');
service.pauseBrowserTemporarily(500);
expect(await service.checkIfRouteContains('mobiflip')).toBe(true);
});
it('should open first article', async() => {
service.clickElementByCss('.blog-widget-list > .infinite-post:first-child');
service.pauseBrowserTemporarily(1000);
});
it('should scroll to sharing buttons', async() => {
await service.scrollToElement('".sharep"');
service.pauseBrowserTemporarily(3000);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment