-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dx: introduce playwright for desktop e2e tests
- Loading branch information
Showing
23 changed files
with
350 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,13 @@ | ||
// SPDX-FileCopyrightText: 2021-2022 The Manyverse Authors | ||
// | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
import {PlaywrightTestConfig} from '@playwright/test'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
testDir: './test/e2e/desktop', | ||
maxFailures: 2, | ||
workers: 1, // no parallelism | ||
}; | ||
|
||
export default config; |
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 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -22,6 +22,7 @@ const localCapabilities = { | |
__dirname, | ||
'..', | ||
'..', | ||
'..', | ||
'android', | ||
'app', | ||
'build', | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,54 @@ | ||
// SPDX-FileCopyrightText: 2022 The Manyverse Authors | ||
// | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
import {expect, test} from '@playwright/test'; | ||
import {Page} from 'playwright-core'; | ||
import setup from './utils'; | ||
|
||
const ctx = setup(); | ||
|
||
let page: Page; | ||
|
||
test.describe('welcome', () => { | ||
test('overview', async () => { | ||
page = await ctx.electronApp!.firstWindow(); | ||
|
||
expect(await page.title()).toBe('Manyverse'); | ||
expect(await page.waitForSelector('"Welcome to Manyverse!"')).toBeTruthy(); | ||
await page.locator('text="Continue" >> nth=0').click(); | ||
}); | ||
|
||
test('off the grid', async () => { | ||
expect(await page.waitForSelector('"Off-the-grid"')).toBeTruthy(); | ||
await page.locator('text="Continue" >> nth=1').click(); | ||
}); | ||
|
||
test('connections', async () => { | ||
expect(await page.waitForSelector('"Many ways to connect"')).toBeTruthy(); | ||
await page.locator('text="Continue" >> nth=2').click(); | ||
}); | ||
|
||
test('moderation', async () => { | ||
expect(await page.waitForSelector('"Shared moderation"')).toBeTruthy(); | ||
await page.locator('text="Continue" >> nth=3').click(); | ||
}); | ||
|
||
test('permanence', async () => { | ||
expect(await page.waitForSelector('"Permanence"')).toBeTruthy(); | ||
await page.locator('text="Continue" >> nth=4').click(); | ||
}); | ||
|
||
test('in construction', async () => { | ||
expect(await page.waitForSelector('"In construction!"')).toBeTruthy(); | ||
await page.locator('text="Continue" >> nth=5').click(); | ||
}); | ||
|
||
test('account', async () => { | ||
expect( | ||
await page.waitForSelector('"Is this your first time?"'), | ||
).toBeTruthy(); | ||
await page.locator('text="Create account"').click(); | ||
await page.waitForTimeout(5000); // give it time to save to localstorage | ||
}); | ||
}); |
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,49 @@ | ||
// SPDX-FileCopyrightText: 2022 The Manyverse Authors | ||
// | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
import {expect, test} from '@playwright/test'; | ||
import {Page} from 'playwright-core'; | ||
import setup from './utils'; | ||
|
||
const ctx = setup(); | ||
|
||
let page: Page; | ||
|
||
test.describe('central', () => { | ||
test('public tab', async () => { | ||
page = await ctx.electronApp!.firstWindow(); | ||
|
||
expect(await page.waitForSelector('"Public posts"')).toBeTruthy(); | ||
expect( | ||
await page.waitForSelector(':has-text("Where is everybody")'), | ||
).toBeTruthy(); | ||
}); | ||
|
||
test('private tab', async () => { | ||
await page.locator('text="Private"').click(); | ||
expect(await page.waitForSelector('"Private chats"')).toBeTruthy(); | ||
expect( | ||
await page.waitForSelector(':has-text("Where is everybody")'), | ||
).toBeTruthy(); | ||
}); | ||
|
||
test('activity tab', async () => { | ||
await page.locator('text="Activity"').click(); | ||
expect(await page.waitForSelector('"Activity"')).toBeTruthy(); | ||
expect( | ||
await page.waitForSelector(':has-text("Where is everybody")'), | ||
).toBeTruthy(); | ||
}); | ||
|
||
test('connections tab', async () => { | ||
await page.locator('text="Connections"').click(); | ||
expect(await page.waitForSelector('"Connected peers"')).toBeTruthy(); | ||
expect(await page.waitForSelector('"Not connected"')).toBeTruthy(); | ||
}); | ||
|
||
test('back to public tab', async () => { | ||
await page.locator('text="Public"').click(); | ||
expect(await page.waitForSelector('"Public posts"')).toBeTruthy(); | ||
}); | ||
}); |
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,43 @@ | ||
// SPDX-FileCopyrightText: 2022 The Manyverse Authors | ||
// | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
import {expect, test} from '@playwright/test'; | ||
import {Page} from 'playwright-core'; | ||
import setup from './utils'; | ||
|
||
const ctx = setup(); | ||
|
||
let page: Page; | ||
|
||
test.describe('compose', () => { | ||
test('opens', async () => { | ||
page = await ctx.electronApp!.firstWindow(); | ||
|
||
const selector = '[aria-label="Floating Action Button"]'; | ||
expect(await page.waitForSelector(selector)).toBeTruthy(); | ||
await page.locator(selector).click(); | ||
}); | ||
|
||
test('can write on the text field', async () => { | ||
const fieldSelector = '[placeholder="Write a public message"]'; | ||
expect(await page.waitForSelector(fieldSelector)).toBeTruthy(); | ||
await page.locator(fieldSelector).fill('Hello mom'); | ||
|
||
const buttonSelector = '"Preview"'; | ||
expect(await page.waitForSelector(buttonSelector)).toBeTruthy(); | ||
await page.locator(buttonSelector).click(); | ||
|
||
const buttonSelector2 = '"Publish"'; | ||
expect(await page.waitForSelector(buttonSelector2)).toBeTruthy(); | ||
await page.locator(buttonSelector2).click(); | ||
}); | ||
|
||
test('can see my post on the feed', async () => { | ||
await page.waitForSelector('"Preview"', {state: 'hidden' as any}); | ||
await page.waitForSelector('"Publish"', {state: 'hidden' as any}); | ||
|
||
const postSelector = '"Hello mom"'; | ||
expect(await page.waitForSelector(postSelector)).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.