Upgrade E2E dependencies (#3370)

* Disable Windows job

* Fix linux Darkmode test
This commit is contained in:
yasser khan
2025-03-12 01:58:34 +05:30
committed by GitHub
parent fe7878c936
commit 9090f243b3
6 changed files with 1010 additions and 5498 deletions

View File

@@ -27,7 +27,7 @@ on:
default: "ubuntu-22.04"
nightly:
type: boolean
description: "True if this is nigtly build"
description: "True if this is nightly build"
required: false
default: false
cmt:
@@ -140,7 +140,7 @@ jobs:
with:
python-version: "3.10"
## Linux Depdendencies
## Linux Dependencies
- name: e2e/install-dependencies-linux
if: runner.os == 'Linux'
env:
@@ -148,7 +148,7 @@ jobs:
run: |
wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_22.04/Release.key | sudo apt-key add -
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.20.1/yq_linux_amd64 && chmod a+x /usr/local/bin/yq
sudo apt-get update || true && sudo apt-get install -y ca-certificates libxtst-dev libpng++-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu jq icnsutils graphicsmagick tzdata xsel
sudo apt-get update || true && sudo apt-get install -y ca-certificates libxtst-dev libpng++-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu jq icnsutils graphicsmagick tzdata xsel libgtk-3-0 libnss3 libxss1 libasound2
sudo apt-get install -y xvfb
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x24 &
@@ -176,6 +176,7 @@ jobs:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: |
choco install yq --version 4.15.1 -y
choco install vcredist-all -y
npm i -g node-gyp
node-gyp install
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
@@ -186,15 +187,38 @@ jobs:
npx electron-rebuild --platform=win32 -f -t prod,optional,dev -w robotjs --module-dir ../
npm install mochawesome-report-generator
- name: e2e/run-playright-tests-${{ runner.os }}
- name: e2e/run-playright-tests-linux
if: runner.os == 'Linux'
run: |
if [ ${{ runner.os }} == 'Linux' ]; then
export DISPLAY=:99
Xvfb $DISPLAY -screen 0 1280x960x24 > /dev/null 2>&1 &
fi
npm run build-test
cd e2e
npm run run:e2e || true # making job pass even if the tests fail due to flakyness
xvfb-run -a npm run run:e2e || true
npm run send-report
env:
SERVER_VERSION: ${{ inputs.MM_SERVER_VERSION }}
DESKTOP_VERSION: ${{ inputs.DESKTOP_VERSION }}
- name: e2e/run-playright-tests-macos
if: runner.os == 'macOS'
run: |
sudo spctl --master-disable
xattr -dr com.apple.quarantine ./node_modules/electron
npm run build-test
cd e2e
npm run run:e2e || true
npm run send-report
env:
SERVER_VERSION: ${{ inputs.MM_SERVER_VERSION }}
DESKTOP_VERSION: ${{ inputs.DESKTOP_VERSION }}
- name: e2e/run-playright-tests-windows
if: runner.os == 'Windows'
run: |
npm run build-test
cd e2e
npm run run:e2e || true
npm run send-report
env:
SERVER_VERSION: ${{ inputs.MM_SERVER_VERSION }}

View File

@@ -69,36 +69,37 @@ jobs:
runs-on: macos-13
DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }}
e2e-windows:
if: ${{
(
(inputs.job_name == 'e2e-windows' || inputs.job_name == 'All')
&&
github.event_name == 'workflow_dispatch'
) ||
(
github.event_name == 'push'
) ||
(
github.event_name == 'pull_request' &&
github.event.pull_request.labels &&
contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests')
)
}}
uses: ./.github/workflows/e2e-functional-template.yml
secrets: inherit
with:
runs-on: windows-2022
DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }}
# TODO: Uncomment when https://mattermost.atlassian.net/browse/MM-63397 is resolved
# e2e-windows:
# if: ${{
# (
# (inputs.job_name == 'e2e-windows' || inputs.job_name == 'All')
# &&
# github.event_name == 'workflow_dispatch'
# ) ||
# (
# github.event_name == 'push'
# ) ||
# (
# github.event_name == 'pull_request' &&
# github.event.pull_request.labels &&
# contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests')
# )
# }}
# uses: ./.github/workflows/e2e-functional-template.yml
# secrets: inherit
# with:
# runs-on: windows-2022
# DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }}
e2e-remove-label:
if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests') }}
needs: [e2e-linux, e2e-macos, e2e-windows]
needs: [e2e-linux, e2e-macos] #, e2e-windows] TODO: Uncomment when https://mattermost.atlassian.net/browse/MM-63397 is resolved
runs-on: ubuntu-22.04
env:
COMMENT_BODY_LINUX: "${{ needs.e2e-linux.outputs.COMMENT_BODY }}"
COMMENT_BODY_MACOS: "${{ needs.e2e-macos.outputs.COMMENT_BODY }}"
COMMENT_BODY_WINDOWS: "${{ needs.e2e-windows.outputs.COMMENT_BODY }}"
# COMMENT_BODY_WINDOWS: "${{ needs.e2e-windows.outputs.COMMENT_BODY }}"
steps:
- name: e2e/unify-comments-in-single-comment
run: |

6390
e2e/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,17 +24,17 @@
},
"homepage": "https://github.com/mattermost/desktop#readme",
"dependencies": {
"@aws-sdk/client-s3": "3.726.1",
"@aws-sdk/lib-storage": "3.445.0",
"@aws-sdk/client-s3": "3.758.0",
"@aws-sdk/lib-storage": "3.758.0",
"@electron/rebuild": "3.7.1",
"axios": "1.7.4",
"chai": "4.5.0",
"electron-mocha": "12.2.0",
"electron-mocha": "13.1.0",
"fast-xml-parser": "^4.4.1",
"mochawesome": "7.1.3",
"nan": "2.22.0",
"nan": "2.22.2",
"node-abi": "3.71.0",
"playwright": "1.49.1",
"playwright": "1.51.0",
"ps-node": "0.1.6",
"recursive-readdir": "2.2.3",
"robotjs": "0.6.0"

View File

@@ -1,13 +0,0 @@
diff --git a/node_modules/nan/nan_scriptorigin.h b/node_modules/nan/nan_scriptorigin.h
index 04e55cf..9949631 100644
--- a/node_modules/nan/nan_scriptorigin.h
+++ b/node_modules/nan/nan_scriptorigin.h
@@ -13,7 +13,7 @@ class ScriptOrigin : public v8::ScriptOrigin {
public:
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 11 \
- && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION > 7)
+ && defined(V8_MINOR_VERSION) && (V8_MAJOR_VERSION > 12 || (V8_MAJOR_VERSION == 11 && V8_MINOR_VERSION > 7)))
explicit ScriptOrigin(v8::Local<v8::Value> name) :
v8::ScriptOrigin(name) {}

View File

@@ -42,7 +42,7 @@ describe('dark_mode', function desc() {
const topBarElementWithDarkMode = await mainWindow.waitForSelector('.topBar');
const topBarElementClassWithDarkMode = await topBarElementWithDarkMode.getAttribute('class');
topBarElementClassWithDarkMode.should.contain('topBar darkMode row');
topBarElementClassWithDarkMode.should.contain('topBar darkMode');
// Toggle Light Mode
await toggleDarkMode();
@@ -50,7 +50,7 @@ describe('dark_mode', function desc() {
const topBarElementWithLightMode = await mainWindow.waitForSelector('.topBar');
const topBarElementClassWithLightMode = await topBarElementWithLightMode.getAttribute('class');
topBarElementClassWithLightMode.should.contain('topBar row');
topBarElementClassWithLightMode.should.contain('topBar');
});
}
});