Created
September 17, 2018 13:28
-
-
Save lydemann/20834db7fecd71d88214ba12eed61c88 to your computer and use it in GitHub Desktop.
app.e2e-spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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