-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(wdio): port lifecycle-basic test suite to wdio (#5478)
- Loading branch information
1 parent
eaf189c
commit bd16dcd
Showing
7 changed files
with
52 additions
and
133 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { h, Fragment } from '@stencil/core'; | ||
import { render } from '@wdio/browser-runner/stencil'; | ||
|
||
describe('lifecycle-basic', function () { | ||
beforeEach(() => { | ||
render({ | ||
template: () => <lifecycle-basic-a></lifecycle-basic-a>, | ||
}); | ||
}); | ||
|
||
it('fire load methods in order', async () => { | ||
await $('lifecycle-basic-a').waitForExist(); | ||
|
||
await browser.pause(200); | ||
|
||
let loads = await $('.lifecycle-loads-a').$$('li'); | ||
await expect(loads.length).toBe(6); | ||
|
||
await expect(loads[0]).toHaveText('componentWillLoad-a'); | ||
await expect(loads[1]).toHaveText('componentWillLoad-b'); | ||
await expect(loads[2]).toHaveText('componentWillLoad-c'); | ||
await expect(loads[3]).toHaveText('componentDidLoad-c'); | ||
await expect(loads[4]).toHaveText('componentDidLoad-b'); | ||
await expect(loads[5]).toHaveText('componentDidLoad-a'); | ||
|
||
let updates = await $('.lifecycle-updates-a').$$('li'); | ||
await expect(updates).not.toBeExisting(); | ||
|
||
const button = $('button'); | ||
await button.click(); | ||
|
||
loads = await $('.lifecycle-loads-a').$$('li'); | ||
await expect(loads.length).toBe(6); | ||
|
||
await expect(loads[0]).toHaveText('componentWillLoad-a'); | ||
await expect(loads[1]).toHaveText('componentWillLoad-b'); | ||
await expect(loads[2]).toHaveText('componentWillLoad-c'); | ||
await expect(loads[3]).toHaveText('componentDidLoad-c'); | ||
await expect(loads[4]).toHaveText('componentDidLoad-b'); | ||
await expect(loads[5]).toHaveText('componentDidLoad-a'); | ||
|
||
updates = await $('.lifecycle-updates-a').$$('li'); | ||
await expect(updates.length).toBe(6); | ||
|
||
await expect(updates[0]).toHaveText('componentWillUpdate-a'); | ||
await expect(updates[1]).toHaveText('componentWillUpdate-b'); | ||
await expect(updates[2]).toHaveText('componentWillUpdate-c'); | ||
await expect(updates[3]).toHaveText('componentDidUpdate-c'); | ||
await expect(updates[4]).toHaveText('componentDidUpdate-b'); | ||
await expect(updates[5]).toHaveText('componentDidUpdate-a'); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.