Files
web2.0-frontend/tests/testcafe/index.test.ts
T
2018-06-20 09:35:41 +03:00

25 lines
771 B
TypeScript

/**
* TestCafé test fixtures.
* This file is used by TestCafé to run end-to-end tests with chrome against the site.
* Tests are grouped into fixtures and fixtures into files.
*/
import { Selector } from 'testcafe';
fixture`Page renders correctly`.page('http://localhost:3000');
test('Paragraph exists and is visible', async t => {
/**
* Test if there is a paragraph on the page.
*/
const p = Selector('p');
await t.expect(await p.exists && await p.visible);
});
test('Header contains text "Aalto-yliopiston sähköinsinöörikilta!"', async t => {
/**
* Test if the header contains the text.
*/
const header = Selector('h1');
const text = await header.textContent;
await t.expect(text.includes('Aalto-yliopiston sähköinsinöörikilta!'));
});