Browse Source

Merge pull request #108 from Empact/fix/e2e-tests

Fix e2e tests to run green
renovate/lint-staged-8.x
JimmyMow 7 years ago
committed by GitHub
parent
commit
67e3e8ea32
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 63
      test/e2e/e2e.spec.js

63
test/e2e/e2e.spec.js

@ -37,7 +37,7 @@ describe('main window', function spec() {
await client.waitUntilWindowLoaded();
await delay(500);
const title = await browserWindow.getTitle();
expect(title).toBe('Hello Electron React!');
expect(title).toBe('Zap');
});
it('should haven\'t any logs in console of main window', async () => {
@ -51,65 +51,4 @@ describe('main window', function spec() {
});
expect(logs).toHaveLength(0);
});
it('should to Counter with click "to Counter" link', async () => {
const { client } = this.app;
await client.click('[data-tid=container] > a');
expect(await findCounter().getText()).toBe('0');
});
it('should display updated count after increment button click', async () => {
const { client } = this.app;
const buttons = await findButtons();
await client.elementIdClick(buttons[0]); // +
expect(await findCounter().getText()).toBe('1');
});
it('should display updated count after descrement button click', async () => {
const { client } = this.app;
const buttons = await findButtons();
await client.elementIdClick(buttons[1]); // -
expect(await findCounter().getText()).toBe('0');
});
it('shouldnt change if even and if odd button clicked', async () => {
const { client } = this.app;
const buttons = await findButtons();
await client.elementIdClick(buttons[2]); // odd
expect(await findCounter().getText()).toBe('0');
});
it('should change if odd and if odd button clicked', async () => {
const { client } = this.app;
const buttons = await findButtons();
await client.elementIdClick(buttons[0]); // +
await client.elementIdClick(buttons[2]); // odd
expect(await findCounter().getText()).toBe('2');
});
it('should change if async button clicked and a second later', async () => {
const { client } = this.app;
const buttons = await findButtons();
await client.elementIdClick(buttons[3]); // async
expect(await findCounter().getText()).toBe('2');
await delay(1500);
expect(await findCounter().getText()).toBe('3');
});
it('should back to home if back button clicked', async () => {
const { client } = this.app;
await client.element(
'[data-tid="backButton"] > a'
).click();
expect(
await client.isExisting('[data-tid="container"]')
).toBe(true);
});
});

Loading…
Cancel
Save