-
Notifications
You must be signed in to change notification settings - Fork 5
feat: recovery banner tests #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6b99378
fix: recovery password banner won't show immediately
Miki-Session 947479c
feat: recovery banner tests
Miki-Session b8448f0
Merge remote-tracking branch 'origin/main' into dev
Miki-Session 51e7826
Merge remote-tracking branch 'origin/main' into dev
Miki-Session da3a1c5
chore: rename mentions row locator
Miki-Session 829f23d
feat: add tests for emoji container
Miki-Session b718ee6
chore: add linked device test
Miki-Session 580c547
chore: cosmetic changes
Bilb a1710d1
Merge pull request #58 from session-foundation/chore/cosmetic-changes
Bilb 9791c0b
fix: wrap mentions test in promise all
Miki-Session File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes
File renamed without changes
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| export const testCommunityLink = | ||
| 'https://chat.lokinet.dev/testing-all-the-things?public_key=1d7e7f92b1ed3643855c98ecac02fc7274033a3467653f047d6e433540c03f17'; | ||
| export const testCommunityName = 'Testing All The Things!'; | ||
|
|
||
| export type DefaultCommunity = | ||
| | 'Lokinet Updates' | ||
| | 'Session Network Updates' | ||
| | 'Session Updates'; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,89 @@ | ||
| import type { Page } from '@playwright/test'; | ||
|
|
||
| import { sleepFor } from '../promise_utils'; | ||
| import { Global, HomeScreen, Settings } from './locators'; | ||
| import { test_Alice_1W } from './setup/sessionTest'; | ||
| import { | ||
| joinDefaultCommunity, | ||
| leaveCommunity, | ||
| } from './utilities/join_community'; | ||
| import { linkedDevice } from './utilities/linked_device'; | ||
| import { | ||
| clickOn, | ||
| hasElementPoppedUpThatShouldnt, | ||
| waitForTestIdWithText, | ||
| } from './utilities/utils'; | ||
|
|
||
| async function bannerShouldNotAppear(window: Page) { | ||
| await waitForTestIdWithText(window, HomeScreen.plusButton.selector); | ||
| await hasElementPoppedUpThatShouldnt( | ||
| window, | ||
| HomeScreen.revealRecoveryPhraseButton.strategy, | ||
| HomeScreen.revealRecoveryPhraseButton.selector, | ||
| ); | ||
| console.log('On home screen, banner did not appear'); | ||
| } | ||
|
|
||
| async function bannerShouldAppear(window: Page) { | ||
| await waitForTestIdWithText(window, HomeScreen.plusButton.selector); | ||
| await waitForTestIdWithText( | ||
| window, | ||
| HomeScreen.revealRecoveryPhraseButton.selector, | ||
| ); | ||
| console.log('On home screen, banner is visible'); | ||
| } | ||
|
|
||
| test_Alice_1W( | ||
| 'Recovery password banner appears after >2 conversations', | ||
| async ({ aliceWindow1 }) => { | ||
| await bannerShouldNotAppear(aliceWindow1); | ||
| await joinDefaultCommunity(aliceWindow1, 'Lokinet Updates'); | ||
| await bannerShouldNotAppear(aliceWindow1); | ||
| await joinDefaultCommunity(aliceWindow1, 'Session Network Updates'); | ||
| await bannerShouldNotAppear(aliceWindow1); | ||
| await joinDefaultCommunity(aliceWindow1, 'Session Updates'); | ||
| await bannerShouldAppear(aliceWindow1); | ||
| }, | ||
| ); | ||
|
|
||
| test_Alice_1W( | ||
| 'Recovery password banner 2 windows', | ||
| async ({ aliceWindow1, alice }) => { | ||
| await joinDefaultCommunity(aliceWindow1, 'Lokinet Updates'); | ||
| await joinDefaultCommunity(aliceWindow1, 'Session Network Updates'); | ||
| await joinDefaultCommunity(aliceWindow1, 'Session Updates'); | ||
| const aliceWindow2 = await linkedDevice(alice.recoveryPassword); | ||
| await sleepFor(2_000); | ||
| await bannerShouldNotAppear(aliceWindow2); | ||
| }, | ||
| ); | ||
|
|
||
| test_Alice_1W( | ||
| 'Recovery password banner persists when conversation count drops below 3', | ||
| async ({ aliceWindow1 }) => { | ||
| await joinDefaultCommunity(aliceWindow1, 'Lokinet Updates'); | ||
| await joinDefaultCommunity(aliceWindow1, 'Session Network Updates'); | ||
| await joinDefaultCommunity(aliceWindow1, 'Session Updates'); | ||
| await bannerShouldAppear(aliceWindow1); | ||
|
|
||
| await leaveCommunity(aliceWindow1, 'Lokinet Updates'); | ||
| await bannerShouldAppear(aliceWindow1); | ||
| }, | ||
| ); | ||
|
|
||
| test_Alice_1W( | ||
| 'Recovery password banner disappears after being opened', | ||
| async ({ aliceWindow1 }) => { | ||
| await joinDefaultCommunity(aliceWindow1, 'Lokinet Updates'); | ||
| await joinDefaultCommunity(aliceWindow1, 'Session Network Updates'); | ||
| await joinDefaultCommunity(aliceWindow1, 'Session Updates'); | ||
| await bannerShouldAppear(aliceWindow1); | ||
| await clickOn(aliceWindow1, HomeScreen.revealRecoveryPhraseButton); | ||
| await waitForTestIdWithText( | ||
| aliceWindow1, | ||
| Settings.recoveryPasswordContainer.selector, | ||
| ); | ||
| await clickOn(aliceWindow1, Global.modalCloseButton); | ||
| await bannerShouldNotAppear(aliceWindow1); | ||
| }, | ||
| ); | ||
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.