Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created September 17, 2018 13:28
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 lydemann/20834db7fecd71d88214ba12eed61c88 to your computer and use it in GitHub Desktop.
Save lydemann/20834db7fecd71d88214ba12eed61c88 to your computer and use it in GitHub Desktop.
app.e2e-spec.ts
import * as blueharvest from 'blue-harvest';
import * as path from 'path';
import { browser } from 'protractor';
import { ExpectHelper } from './helpers/expect-helpers';
import { TodosPage } from './todos.po';
const goldenPath = path.join(__dirname, '..', `goldens/todos.png`);
describe('workspace-project App', () => {
let page: TodosPage;
beforeEach(() => {
page = new TodosPage();
});
it('should display 2 todo items', async () => {
await page.navigateTo();
const res = await page.getTodos().count();
await ExpectHelper.expectOrRetry(() => res === 2);
const data = await browser.takeScreenshot();
const result = await blueharvest.compareScreenshot(data, goldenPath);
await expect(result).toBeTruthy();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment