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" default: "ubuntu-22.04"
nightly: nightly:
type: boolean type: boolean
description: "True if this is nigtly build" description: "True if this is nightly build"
required: false required: false
default: false default: false
cmt: cmt:
@@ -140,7 +140,7 @@ jobs:
with: with:
python-version: "3.10" python-version: "3.10"
## Linux Depdendencies ## Linux Dependencies
- name: e2e/install-dependencies-linux - name: e2e/install-dependencies-linux
if: runner.os == 'Linux' if: runner.os == 'Linux'
env: env:
@@ -148,7 +148,7 @@ jobs:
run: | run: |
wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_22.04/Release.key | sudo apt-key add - 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 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 sudo apt-get install -y xvfb
export DISPLAY=:99 export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x24 & Xvfb :99 -screen 0 1024x768x24 &
@@ -176,6 +176,7 @@ jobs:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: | run: |
choco install yq --version 4.15.1 -y choco install yq --version 4.15.1 -y
choco install vcredist-all -y
npm i -g node-gyp npm i -g node-gyp
node-gyp install 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" node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
@@ -186,18 +187,41 @@ jobs:
npx electron-rebuild --platform=win32 -f -t prod,optional,dev -w robotjs --module-dir ../ npx electron-rebuild --platform=win32 -f -t prod,optional,dev -w robotjs --module-dir ../
npm install mochawesome-report-generator npm install mochawesome-report-generator
- name: e2e/run-playright-tests-${{ runner.os }} - name: e2e/run-playright-tests-linux
if: runner.os == 'Linux'
run: | run: |
if [ ${{ runner.os }} == 'Linux' ]; then export DISPLAY=:99
export DISPLAY=:99 Xvfb $DISPLAY -screen 0 1280x960x24 > /dev/null 2>&1 &
Xvfb $DISPLAY -screen 0 1280x960x24 > /dev/null 2>&1 &
fi
npm run build-test npm run build-test
cd e2e 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 npm run send-report
env: env:
SERVER_VERSION: ${{ inputs.MM_SERVER_VERSION}} 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 }}
DESKTOP_VERSION: ${{ inputs.DESKTOP_VERSION }} DESKTOP_VERSION: ${{ inputs.DESKTOP_VERSION }}
- name: e2e/analyze-flaky-tests - name: e2e/analyze-flaky-tests

View File

@@ -69,36 +69,37 @@ jobs:
runs-on: macos-13 runs-on: macos-13
DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }} DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }}
e2e-windows: # TODO: Uncomment when https://mattermost.atlassian.net/browse/MM-63397 is resolved
if: ${{ # e2e-windows:
( # if: ${{
(inputs.job_name == 'e2e-windows' || inputs.job_name == 'All') # (
&& # (inputs.job_name == 'e2e-windows' || inputs.job_name == 'All')
github.event_name == 'workflow_dispatch' # &&
) || # github.event_name == 'workflow_dispatch'
( # ) ||
github.event_name == 'push' # (
) || # github.event_name == 'push'
( # ) ||
github.event_name == 'pull_request' && # (
github.event.pull_request.labels && # github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests') # 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 # uses: ./.github/workflows/e2e-functional-template.yml
with: # secrets: inherit
runs-on: windows-2022 # with:
DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }} # runs-on: windows-2022
# DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }}
e2e-remove-label: e2e-remove-label:
if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests') }} 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 runs-on: ubuntu-22.04
env: env:
COMMENT_BODY_LINUX: "${{ needs.e2e-linux.outputs.COMMENT_BODY }}" COMMENT_BODY_LINUX: "${{ needs.e2e-linux.outputs.COMMENT_BODY }}"
COMMENT_BODY_MACOS: "${{ needs.e2e-macos.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: steps:
- name: e2e/unify-comments-in-single-comment - name: e2e/unify-comments-in-single-comment
run: | 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", "homepage": "https://github.com/mattermost/desktop#readme",
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "3.726.1", "@aws-sdk/client-s3": "3.758.0",
"@aws-sdk/lib-storage": "3.445.0", "@aws-sdk/lib-storage": "3.758.0",
"@electron/rebuild": "3.7.1", "@electron/rebuild": "3.7.1",
"axios": "1.7.4", "axios": "1.7.4",
"chai": "4.5.0", "chai": "4.5.0",
"electron-mocha": "12.2.0", "electron-mocha": "13.1.0",
"fast-xml-parser": "^4.4.1", "fast-xml-parser": "^4.4.1",
"mochawesome": "7.1.3", "mochawesome": "7.1.3",
"nan": "2.22.0", "nan": "2.22.2",
"node-abi": "3.71.0", "node-abi": "3.71.0",
"playwright": "1.49.1", "playwright": "1.51.0",
"ps-node": "0.1.6", "ps-node": "0.1.6",
"recursive-readdir": "2.2.3", "recursive-readdir": "2.2.3",
"robotjs": "0.6.0" "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 topBarElementWithDarkMode = await mainWindow.waitForSelector('.topBar');
const topBarElementClassWithDarkMode = await topBarElementWithDarkMode.getAttribute('class'); const topBarElementClassWithDarkMode = await topBarElementWithDarkMode.getAttribute('class');
topBarElementClassWithDarkMode.should.contain('topBar darkMode row'); topBarElementClassWithDarkMode.should.contain('topBar darkMode');
// Toggle Light Mode // Toggle Light Mode
await toggleDarkMode(); await toggleDarkMode();
@@ -50,7 +50,7 @@ describe('dark_mode', function desc() {
const topBarElementWithLightMode = await mainWindow.waitForSelector('.topBar'); const topBarElementWithLightMode = await mainWindow.waitForSelector('.topBar');
const topBarElementClassWithLightMode = await topBarElementWithLightMode.getAttribute('class'); const topBarElementClassWithLightMode = await topBarElementWithLightMode.getAttribute('class');
topBarElementClassWithLightMode.should.contain('topBar row'); topBarElementClassWithLightMode.should.contain('topBar');
}); });
} }
}); });