Skip to content

Regression tests groups #30

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
merged 90 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
0fe44bb
feat: fix working v1 with session-tooling. Still need to use it
Bilb Jul 27, 2024
7ea7d22
working tiny test pushing configs and print seedphrase
Bilb Jul 27, 2024
cad271b
Merge branch 'main' into add-tooling
burtonemily Oct 11, 2024
a2cee2b
Merge pull request #3 from Bilb/add-tooling
burtonemily Oct 11, 2024
61c3f33
feat: fix working v1 with session-tooling. Still need to use it
Bilb Jul 27, 2024
c926c85
working tiny test pushing configs and print seedphrase
Bilb Jul 27, 2024
5551e77
Merge branch 'main' of github.com:burtonemily/session-playwright
burtonemily Oct 16, 2024
189afd4
Revert "feat: fix working v1 with session-tooling"
burtonemily Nov 11, 2024
df1d137
Merge pull request #4 from burtonemily/revert-3-add-tooling
burtonemily Nov 11, 2024
4931b96
fix: some tests fixed, all groups test still broken
Bilb Nov 26, 2024
fa0e4b1
fix: use human readable timer datatestids
Bilb Nov 26, 2024
4a408b4
Merge pull request #6 from Bilb/fix-some-test-group
burtonemily Nov 26, 2024
85c2045
fix: fix the non-groups test for the groups changes
Bilb Nov 28, 2024
31980a4
Removed package.json
burtonemily Dec 10, 2024
bd31b33
Merge branch 'main' of github.com:burtonemily/session-playwright
burtonemily Dec 10, 2024
7dd7bb9
Readds package.json
burtonemily Dec 10, 2024
78154c3
Merge branch 'main' of github.com:session-foundation/session-playwright
burtonemily Dec 10, 2024
388ec2d
Merge pull request #7 from Bilb/fix-test-with-groups
burtonemily Dec 10, 2024
8eff6d9
Merging main into local
burtonemily Dec 10, 2024
cdd68d2
Revert "Merge pull request #7 from Bilb/fix-test-with-groups"
burtonemily Dec 10, 2024
612bd9c
Cleaning up js files and js.map files
burtonemily Dec 10, 2024
a44e7de
fixes js compiling issues
burtonemily Dec 10, 2024
de4a0c3
updated control message
burtonemily Dec 11, 2024
921d636
tracks eslint file
burtonemily Dec 11, 2024
2cd6d28
Adds function to sort users by pubkey, updates mentions test, fixes s…
burtonemily Dec 16, 2024
593c333
Starts disappearing messages checks for groups
burtonemily Jan 8, 2025
b8942c3
Merge branch 'main' into main_2
burtonemily Jan 10, 2025
547c6fa
Merge pull request #9 from burtonemily/main_2
burtonemily Jan 10, 2025
7fb30bd
Merge branch 'session-foundation:main' into main
burtonemily Jan 10, 2025
bbef3d5
Merge branch 'main' into disappearing_messages_groups
burtonemily Jan 10, 2025
3f80aa2
Merge pull request #10 from burtonemily/disappearing_messages_groups
burtonemily Jan 10, 2025
54724f0
Merge branch 'groups_rebuild' into main
burtonemily Jan 12, 2025
c8a57dc
Merge pull request #11 from burtonemily/main
burtonemily Jan 12, 2025
443aea2
Adds in checkModalStrings, formattedTime, disappearActions and update…
burtonemily Jan 15, 2025
61bb673
Adds in checkModalStrings for message request tests and cleans up com…
burtonemily Jan 22, 2025
33f0569
feat: add regression tests to groups_branch
Bilb Jan 24, 2025
6c08d10
feat: use new localisation logic (all in one .ts file)
Bilb Jan 28, 2025
158954f
fix: block user test
Bilb Jan 28, 2025
5671320
updating screenshot
burtonemily Jan 29, 2025
dca6ac8
resolving merge conflicts
burtonemily Jan 29, 2025
29729fa
resolving merge conflicts
burtonemily Jan 29, 2025
9c791e7
Merge branch 'regression-tests-groups' into groups_rebuild
burtonemily Jan 29, 2025
4c9be9d
fix: typo
Bilb Jan 30, 2025
372140d
Merge remote-tracking branch 'foundation/regression-tests-groups' int…
Bilb Jan 30, 2025
ca96927
remove unnecessary line
burtonemily Jan 31, 2025
ff67a7d
Merge branch 'groups_rebuild' of github.com:burtonemily/session-playw…
burtonemily Jan 31, 2025
b8332f6
merge conflicts
burtonemily Jan 31, 2025
bd43bfa
Removing async from formattedTime function
burtonemily Feb 5, 2025
034418a
Update tests/automation/user_actions.spec.ts
burtonemily Feb 6, 2025
7675025
Merge pull request #19 from Bilb/feat-use-new-localisation-logic
burtonemily Feb 6, 2025
4bd8c5d
Merge branch 'regression-tests-groups' into groups_rebuild
burtonemily Feb 6, 2025
cfeeeae
chore: addressing feedback to add in default disappearing messages op…
burtonemily Feb 7, 2025
7e94bb2
Merge branch 'groups_rebuild' of github.com:burtonemily/session-playw…
burtonemily Feb 7, 2025
e00d1b3
Addresses feedback
burtonemily Feb 9, 2025
9eaca65
Merge pull request #22 from burtonemily/groups_rebuild
burtonemily Feb 9, 2025
ef2034b
updating tests with new strings and fixing tests for latest groups ch…
burtonemily Mar 3, 2025
d633498
chore: rename unstable to dev for session-desktop default clone
Bilb Mar 11, 2025
bd075d6
feat: add will's repo as an option
Bilb Mar 13, 2025
6644b52
Merge pull request #12 from Bilb/chore/update-session-desktop-dev-branch
burtonemily Mar 13, 2025
bc9e56a
fix: use plurals for worker in env too
Bilb Mar 14, 2025
62cb718
chore: update electron version to match the new one used by session
Bilb Mar 18, 2025
ea93b44
updating changes to strings
burtonemily Mar 19, 2025
2f7ab5f
Merge branch 'groups_rebuild' of https://github.com/burtonemily/sessi…
burtonemily Mar 19, 2025
15dd34c
Merge pull request #13 from session-foundation/add-will-choice-repo-s…
burtonemily Mar 21, 2025
4cdfeaa
Merge pull request #14 from Bilb/bump-electron-version
burtonemily Mar 21, 2025
b8cebc3
Addressed feedback
burtonemily Mar 21, 2025
8fefd4e
chore: update lockfile
Bilb Mar 24, 2025
48abb6d
Merge pull request #15 from Bilb/groups_rebuild
burtonemily Mar 24, 2025
d60f833
addresses feedback
burtonemily Mar 24, 2025
4c923fe
Merge branch 'groups_rebuild' of https://github.com/burtonemily/sessi…
burtonemily Mar 24, 2025
8b72560
chore: lint
Bilb Mar 24, 2025
7d88cb5
adds in test tags for clear all modal
burtonemily Mar 25, 2025
954008b
Merge pull request #28 from burtonemily/groups_rebuild
burtonemily Mar 25, 2025
4a29581
Merge pull request #16 from Bilb/groups_rebuild
burtonemily Mar 25, 2025
264e183
chore: lint
Bilb Mar 25, 2025
8fcbe46
Merge pull request #17 from Bilb/lint
burtonemily Mar 25, 2025
9e0b8f3
Merge pull request #29 from burtonemily/groups_rebuild
burtonemily Mar 25, 2025
b36027e
adding back in modal for clearAll
burtonemily Mar 26, 2025
ced33f3
Merge branch 'groups_rebuild' of https://github.com/burtonemily/sessi…
burtonemily Mar 26, 2025
15bdc7e
fixing merge conflicts
burtonemily Mar 26, 2025
5da539c
merging main into branch
burtonemily Mar 26, 2025
1c4dd13
fixing merge conflicts
burtonemily Mar 26, 2025
28fb9d2
fix: delete and restore group test
Bilb Mar 26, 2025
8fc3363
chore: fix yarn.lock
Bilb Mar 26, 2025
54e678f
fix: tests for remove-legacy-disappearing-message desktop branch
Bilb Mar 30, 2025
7fa4e61
chore: no opt out of our custom reporter for playwright
Bilb Mar 31, 2025
0a2159a
Merge pull request #19 from Bilb/fix-delete-restore-group
burtonemily Mar 31, 2025
2f4a8dd
Merge branch 'regression-tests-groups' into groups_rebuild
burtonemily Mar 31, 2025
014a079
cleaning up PR
burtonemily Mar 31, 2025
fe781a9
Merge pull request #31 from burtonemily/groups_rebuild
Bilb Mar 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SESSION_DESKTOP_ROOT="<path to session desktop root>"
PLAYWRIGHT_CUSTOM_REPORTER=1
PLAYWRIGHT_REPEAT_COUNT=0
PLAYWRIGHT_RETRIES_COUNT=0
PLAYWRIGHT_WORKERS_COUNT=1
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.eslintrc.js
*.js
tests/localization/*
161 changes: 157 additions & 4 deletions .github/workflows/desktop-regression.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run android regression tests
name: Run desktop regression tests
on:
workflow_dispatch:
inputs:
Expand All @@ -7,15 +7,168 @@ on:
required: true
type: choice
options:
- oxen-io/session-playwright
- session-foundation/session-playwright
- burtonemily/session-playwright
- bilb/session-playwright
default: oxen-io/session-playwright
default: session-foundation/session-playwright

BRANCH_TO_CHECKOUT_PW:
description: 'branch to checkout on session-playwright'
required: true
type: string
default: regression-tests-groups

SESSION_DESKTOP_REPO:
description: 'Session desktop repo to checkout'
required: true
type: choice
options:
- session-foundation/session-desktop
- bilb/session-desktop
- yougotwill/session-desktop
default: session-foundation/session-desktop

BRANCH_TO_CHECKOUT_SESSION:
description: 'Branch to checkout on session-desktop'
required: true
type: string
default: dev

PLAYWRIGHT_REPEAT_COUNT:
description: 'Repeats of each tests (0 to only run each once)'
required: true
type: number
default: 0

PLAYWRIGHT_RETRIES_COUNT:
description: 'Retries of each tests (0 to only run each once, 1 to run another attempt)'
required: true
type: number
default: 0

PLAYWRIGHT_WORKERS_COUNT:
description: 'Playwright workers to start'
required: true
type: number
default: 8

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
desktop-regression:
name: Desktop Regression Tests
runs-on: [self-hosted, linux, x64, qa-desktop]
runs-on: [self-hosted, Linux, X64, qa-desktop]
container:
image: mcr.microsoft.com/playwright:v1.51.0-noble
options: --cpus 16

env:
PLAYWRIGHT_REPEAT_COUNT: ${{ github.event.inputs.PLAYWRIGHT_REPEAT_COUNT }}
PLAYWRIGHT_RETRIES_COUNT: ${{ github.event.inputs.PLAYWRIGHT_RETRIES_COUNT }}
PLAYWRIGHT_WORKERS_COUNT: ${{ github.event.inputs.PLAYWRIGHT_WORKERS_COUNT }}
DESKTOP_CACHED_FOLDER: desktop/node_modules

steps:
- uses: actions/checkout@v4
- name: Runner Details
run: |
echo "PLAYWRIGHT_REPO ${{ github.event.inputs.PLAYWRIGHT_REPO }}"
echo "BRANCH_TO_CHECKOUT_PW ${{ github.event.inputs.BRANCH_TO_CHECKOUT_PW }}"
echo "SESSION_DESKTOP_REPO ${{ github.event.inputs.SESSION_DESKTOP_REPO }}"
echo "BRANCH_TO_CHECKOUT_SESSION ${{ github.event.inputs.BRANCH_TO_CHECKOUT_SESSION }}"

- uses: actions/checkout@v4
name: 'Checkout playwright'
with:
repository: ${{ github.event.inputs.PLAYWRIGHT_REPO }}
ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT_PW }}
path: 'playwright'

- name: Install system deps
run: apt update && apt install -y git g++ build-essential cmake

- uses: actions/checkout@v4
name: 'Checkout Session desktop'
with:
repository: ${{ github.event.inputs.SESSION_DESKTOP_REPO }}
ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT_SESSION }}
path: 'desktop'

# Note: caching is breaking things up (app doesn't start)
# - name: Calculate desktop cache key
# run: |
# echo "CACHE_KEY=${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('desktop/package.json', 'desktop/yarn.lock', 'desktop/patches/**') }}" >> $GITHUB_ENV

- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: 'desktop/.nvmrc'

- uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install setuptools for python 3.12
shell: bash
run: python -m pip install --upgrade pip setuptools

# Note: caching is breaking things up (app doesn't start)
# - uses: actions/cache/restore@v4
# id: cache-desktop-modules
# with:
# path: ${{ env.DESKTOP_CACHED_FOLDER }}
# key: ${{ env.CACHE_KEY }}

- name: Install yarn
run: |
npm install -g yarn

- name: List desktop folder
run: |
pwd
ls -la desktop

- name: List playwright folder
run: |
pwd
ls -la playwright

- name: Install desktop dependencies
shell: bash
# if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: cd $GITHUB_WORKSPACE/desktop && yarn install --frozen-lockfile --network-timeout 600000

# Note: caching is breaking things up (app doesn't start)
# - uses: actions/cache/save@v4
# if: always()
# with:
# path: ${{ env.DESKTOP_CACHED_FOLDER }}
# key: ${{ env.CACHE_KEY }}

- name: Build desktop
shell: bash
run: cd $GITHUB_WORKSPACE/desktop && yarn build-everything

- name: Install playwright dependencies
run: |
cd $GITHUB_WORKSPACE/playwright && yarn install --frozen-lockfile

- name: Build the Desktop tests
run: |
cd $GITHUB_WORKSPACE/playwright
yarn tsc

- name: Run the Desktop tests
run: |
cd $GITHUB_WORKSPACE/playwright
SESSION_DESKTOP_ROOT=$GITHUB_WORKSPACE/desktop nice ionice xvfb-run --auto-servernum --server-num=1 --server-args='-screen 0, 1920x1080x24' yarn test
# DEBUG="pw:*"

- name: Kill all running electron app
if: always()
continue-on-error: true # just so we don't fail
shell: bash
run: |
killall electron;
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ test-results/
/*.js
*.js
*.js.map
/*.js.map
**/*.js.map
.vscode/settings.json
tests/automation/todo
allure-report
Expand All @@ -15,3 +17,6 @@ TODO.md
playwright.config.js
sessionReporter.js
.env
output/
dist/
.eslintcache
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.15.0
20.18.2
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This repository holds the code to do regression testing with Playwright for Sess
## Setup


`git clone https://github.com/oxen-io/session-playwright/`
`git clone https://github.com/session-foundation/session-playwright/`

Install [nvm](https://github.com/nvm-sh/nvm) or [nvm for windows](https://github.com/coreybutler/nvm-windows).

Expand All @@ -30,10 +30,6 @@ Create your own config from the `.env.sample` and edit the values to match your
- *type*: string
- *default*: 1
- *description*: the path to the root of session-desktop to test
- `PLAYWRIGHT_CUSTOM_REPORTER`
- *type*: number
- *default*: undefined
- *description*: set to 1 to use our custom reporter, see `sessionReporter.ts`
- `PLAYWRIGHT_REPEAT_COUNT`
- *type*: number
- *default*: 0
Expand Down
3 changes: 3 additions & 0 deletions __screenshots__/Change-avatar/avatar-updated-blue-darwin.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "session-playwright",
"version": "1.0.0",
"main": "index.js",
"repository": "git@github.com:oxen-io/session-playwright.git",
"repository": "git@github.com:session-foundation/session-playwright.git",
"author": "Audric Ackermann <audric@loki.network>",
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.50.1",
"@playwright/test": "^1.51",
"@types/fs-extra": "^11.0.1",
"@types/lodash": "^4.14.196",
"@types/uuid": "^9.0.8",
Expand All @@ -15,7 +15,7 @@
"allure-commandline": "^2.23.1",
"allure-playwright": "2.6.0",
"dotenv": "^16.4.5",
"electron": "^25.4.0",
"electron": "34.2.0",
"eslint": "^8.46.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
Expand All @@ -30,7 +30,8 @@
"uuid": "^9.0.1"
},
"scripts": {
"lint": "yarn prettier . --write && yarn eslint .",
"build": "yarn tsc --watch",
"lint": "yarn prettier . --write --cache && yarn eslint . --cache",
"dev": "yarn tsc --watch",
"test": "npx playwright test",
"watch": "tsc -w",
Expand Down
11 changes: 3 additions & 8 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import { defineConfig } from '@playwright/test';
import { isEmpty, toNumber } from 'lodash';
import { toNumber } from 'lodash';

import dotenv from 'dotenv';
import { screenshotFolder } from './tests/automation/constants/variables';

dotenv.config();

const useSessionReporter = !isEmpty(process.env.PLAYWRIGHT_CUSTOM_REPORTER);

export default defineConfig({
timeout: 350000,
globalTimeout: 6000000,
reporter: [
useSessionReporter ? ['./sessionReporter.ts'] : ['list'],
['allure-playwright'],
],
reporter: [['./sessionReporter.ts'], ['allure-playwright']],
testDir: './tests/automation',
testIgnore: '*.js',
outputDir: './tests/automation/test-results',
Expand All @@ -28,5 +23,5 @@ export default defineConfig({
reportSlowTests: null,
fullyParallel: true, // otherwise, tests in the same file are not run in parallel
globalSetup: './global.setup', // clean leftovers of previous test runs on start, runs only once
snapshotPathTemplate: screenshotFolder + '/{testName}/{arg}-{platform}{ext}',
snapshotPathTemplate: screenshotFolder + '/{testName}/{arg}-{platform}{ext}',
});
3 changes: 3 additions & 0 deletions screenshots/landing-page-states/new-account-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions screenshots/landing-page-states/restored-account-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions sessionReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ function printFailedTestLogs() {

class SessionReporter implements Reporter {
private startTime = 0;

private allTestsCount = 0;

private allResults: Array<TestAndResult> = [];

private countWorkers = 1;

onBegin(config: FullConfig, suite: Suite) {
Expand Down
31 changes: 9 additions & 22 deletions tests/automation/community_tests.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { testCommunityName } from './constants/community';
import { test_Alice_2W, test_Alice_2W_Bob_1W } from './setup/sessionTest';
import { test_Alice_1W_Bob_1W, test_Alice_2W } from './setup/sessionTest';
import { joinCommunity } from './utilities/join_community';
import { sendMessage } from './utilities/message';
import { replyTo } from './utilities/reply_message';
import {
clickOnTestIdWithText,
typeIntoInput,
waitForLoadingAnimationToFinish,
} from './utilities/utils';
import { sendMedia } from './utilities/send_media';
import { clickOnTestIdWithText } from './utilities/utils';

test_Alice_2W('Join community', async ({ aliceWindow1, aliceWindow2 }) => {
await joinCommunity(aliceWindow1);
await waitForLoadingAnimationToFinish(aliceWindow1, 'loading-spinner');
await clickOnTestIdWithText(aliceWindow1, 'scroll-to-bottom-button');
await sendMessage(aliceWindow1, 'Hello, community!');
// Check linked device for community
Expand All @@ -22,17 +18,17 @@ test_Alice_2W('Join community', async ({ aliceWindow1, aliceWindow2 }) => {
);
});

test_Alice_2W_Bob_1W(
test_Alice_1W_Bob_1W(
'Send image to community',
async ({ alice, bob, aliceWindow1, bobWindow1 }) => {
const testMessage = 'Testing sending images to communities';
const testImageMessage = `Image message + ${Date.now()}`;
const testReply = `${bob.userName} replying to image from ${alice.userName}`;
await Promise.all([joinCommunity(aliceWindow1), joinCommunity(bobWindow1)]);
await Promise.all([
waitForLoadingAnimationToFinish(aliceWindow1, 'loading-spinner'),
waitForLoadingAnimationToFinish(bobWindow1, 'loading-spinner'),
]);
// await Promise.all([
// waitForLoadingAnimationToFinish(aliceWindow1, 'loading-spinner'),
// waitForLoadingAnimationToFinish(bobWindow1, 'loading-spinner'),
// ]);
await Promise.all([
clickOnTestIdWithText(aliceWindow1, 'scroll-to-bottom-button'),
clickOnTestIdWithText(bobWindow1, 'scroll-to-bottom-button'),
Expand All @@ -44,16 +40,7 @@ test_Alice_2W_Bob_1W(
'module-conversation__user__profile-name',
testCommunityName,
);
await aliceWindow1.setInputFiles(
"input[type='file']",
'sample_files/test-image.png',
);
await typeIntoInput(
aliceWindow1,
'message-input-text-area',
testImageMessage,
);
await clickOnTestIdWithText(aliceWindow1, 'send-message-button');
await sendMedia(aliceWindow1, 'sample_files/test-image.png', testImageMessage);
await replyTo({
senderWindow: bobWindow1,
textMessage: testImageMessage,
Expand Down
Loading