Skip to content

Commit

Permalink
LL-7990 Playwright (LedgerHQ#4294)
Browse files Browse the repository at this point in the history
LL-7990 integrate playwright to the CI

* kaboom

* environment variables, mocks and models

* enable videos

* manager spec, account spec with models, configuration, codecov, allure-reports

* better artifact management

* added video recording

* configuration

* gitignore videos

* full config + CI environment

* screenshots removed

* better code/test coverage

* fixed manager.spec / nyc conf

* artifacts/

* comments & func renaming

* demo

* post demo

* Update tsconfig.json

Co-authored-by: Valentin D. Pinkman <valentin.d.pinkman@icloud.com>

* Update tsconfig.json

Co-authored-by: Valentin D. Pinkman <valentin.d.pinkman@icloud.com>

* added initial CI workflow

* chore: setup playwright and run it in CI

* 🚀

* remove python setup

* test: xvfb with options for linux

* update snapshots

* update workflows

* wip: generate-screenshots-action

* wip: generate-screenshots-action test

* update ui workflow with xvbf for linux

* remove script

* rename file

* test

* remove workflow

* simplify workflow

* remove option on xvfb

* update screenshots

* fix typo

* fix typo

* remove python setup

* remove failfast

* add executable path

* test linux ??

* run on linux ?

* update generate screenshot action

* try fix linux ci

* wat

* more playing with xvfb to get linux working

* more workflow tinkering

* trying with latest ubuntu

* trying with auto servernum in run test command

* try fix linux ci

* 🔨

* 🔨

* 🔨

* 🔨

* added extra elctron arg

* removed process env

* added process env back in

* changed debug level

* removed different screen size for linux

* Trigger Build

* updated run test command

* remove electronPath

* action: generate screenshots test

* fix git setup

* fix git setup

* always status

* log always

* log always

* pom rework (missing rework on locators)

* try

* added some types on common.ts & ci ty 🔨

* upgrade to 1.17.0-rc.1

* update screenshots

* removed 💩, allure reports & --retries

* fix conf

* fix html reporter path

* fix ManagerPage.ts

* pull --rebase

* update screenshots

* wip: upload images

* manager & accounts stable + currencies

* onboarding stabilizing

* first attempt to download artifacts

* update screenshots

* with self hosted runners

* move playwright deps

* move playwright deps in linux job

* execute correct script

* generate with self hosted runners

* fix

* update screenshots

* add update

* fix gh installation

* install yarn

* size disk to 50 giga

* size disk to 100 giga

* disk space logging

* fix disk size

* update screenshots

* update screenshots

* update screenshots

* fix /generate-screenshot command

* fixed waitFor css animation

* debug pw api

* modal css selector without style

* update screenshots

* yarn install was missing

* update screenshots

* adds shell for windows

* Update generate-screenshots-temp.yml

* playwright@1.17

* last chance fix?

* fix macos yarn timeout

* update screenshots

* update screenshots

* update actions

* test check on git status

* use new ami

* syntax fix

* syntax fix 2

* add name to output

* viewport 💩 and playwright 1.17 stable

* better conditioning for commit

* update screenshots (windows-latest)

* update screenshots (windows-latest)

* update screenshots (macos-latest)

* fix condition on generate screenshots

* test post ui action

* remove jest and lint from macos/windows

* LL-8245: password lock spec, settings spec migration & stabilization

* update screenshots (windows-latest)

* prettier 🔨

* rename actions and deactivate macos

* macos setup

* account fails during accounts scan

* update screenshots (Linux)

* update screenshots (windows-latest)

* kill apt-get before running it

* last config before merge?

* fix the killall to not fail

* fix the killall to not fail syntax

* change name of actions

* syntax fix

* syntax fix 2

* syntax fix 3

Co-authored-by: Valentin D. Pinkman <valentin.d.pinkman@icloud.com>
Co-authored-by: Gregor Gilchrist <gregor.gilchrist@ledger.fr>
Co-authored-by: Valentin D. Pinkman <valentin.d.pinkman@hey.com>
Co-authored-by: ggilchrist-ledger <87659842+ggilchrist-ledger@users.noreply.github.com>
Co-authored-by: Team Live <team-live@ledger.fr>
  • Loading branch information
6 people authored Dec 2, 2021
1 parent 9032e39 commit 43eb6e5
Show file tree
Hide file tree
Showing 226 changed files with 4,444 additions and 2,486 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = {
"promise/param-names": 0,
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"jest/no-done-callback": 0,
},
settings: {
react: {
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/comment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const main = async () => {
if (imgChanged.length === 1 && imgChanged[0] === "") {
imgChanged = [];
}
} catch(e) {
} catch (e) {
imgChanged = [];
}
const testoutput = await fs.readFile(core.getInput("testoutput"), "utf8");
Expand Down
54 changes: 54 additions & 0 deletions .github/actions/prepare-comment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: prepare comment body
description: prepare comment for reporting
author: valpinkman
outputs:
bodySlack:
description: message formatted body for slack
bodySlackAuthor:
description: message formatted body for slack author
slackAuthor:
description: slack handle of the author
inputs:
sha:
description: prNumber
required: true
images:
description: stringified array of images to include in body of comment
required: true
fullrepo:
description: full repo name
required: true
runId:
description: runId
required: true
from:
description: from
required: true
to:
description: to
required: true
pullId:
description: pullId
required: true
author:
description: author
required: true
imgChanged:
description: imgChanged
required: true
testoutput:
description: testoutput
required: true
lintoutput:
description: lintoutput
required: true
jestoutput:
description: jestoutput
required: true
runs:
using: node12
main: index.js

branding:
icon: align-center
color: white
Empty file.
27 changes: 19 additions & 8 deletions .github/actions/upload-images/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const uploadImage = async () => {
const path = core.getInput("path");
const fullPath = resolve(path);

// if (fs.existsSync(fullPath)) {
// throw new Error("the path provided does not exists");
// }

const upload = async (file, i = 0) => {
if (i > 2) {
return "error";
Expand Down Expand Up @@ -43,16 +39,31 @@ const uploadImage = async () => {
}
};

const getAllFiles = currentPath => {
let results = [];
const dirents = fs.readdirSync(currentPath, { withFileTypes: true });
dirents.forEach(dirent => {
const newPath = resolve(currentPath, dirent.name);
const stat = fs.statSync(newPath);
if (stat && stat.isDirectory()) {
results = results.concat(getAllFiles(newPath));
} else {
results.push(newPath);
}
});
return results;
};

let files;
try {
files = fs.readdirSync(fullPath, { withFileTypes: true });
files = files.filter(f => f.isFile()).map(f => f.name);
files = getAllFiles(fullPath);
console.log(files);
} catch {
return core.setOutput("images", []);
}

const resultsP = files.map(file => {
const img = fs.readFileSync(`${fullPath}/${file}`);
const resultsP = files.map(async file => {
const img = fs.readFileSync(`${file}`);
return upload(img);
});

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/bundle-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: bundle app
name: Bundle App
on:
pull_request:
branches:
Expand All @@ -15,7 +15,6 @@ jobs:
steps:
- name: Cancel Previous Runs
run: curl -i -L -X GET 'https://github-actions-live.ledger.tools/api/cancel-previous-run?runId=${{ github.run_id }}&owner=LedgerHQ&repo=ledger-live-desktop&branch=${{ github.event.pull_request.head.ref }}&headSha=${{ github.event.pull_request.head.sha }}'

bundle-macos:
runs-on: macos-latest
needs: cancel-previous
Expand Down Expand Up @@ -47,7 +46,7 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: install dependencies
run: JOBS=max yarn --frozen-lockfile
run: JOBS=max yarn --frozen-lockfile --network-timeout 100000
- uses: ledgerhq/actions/get-package-infos@v2.0.0
id: version
- name: set beta name
Expand Down Expand Up @@ -133,6 +132,8 @@ jobs:
run: |
git config user.email "team-live@ledger.fr"
git config user.name "Team Live"
- name: kill apt-get
run: sudo killall apt-get apt || echo OK
- name: install linux dependencies
run: sudo apt-get update && sudo apt-get install libudev-dev libusb-1.0-0-dev
- name: install and switch to GCC 5.4
Expand All @@ -147,7 +148,7 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: install dependencies
run: JOBS=max yarn --frozen-lockfile
run: JOBS=max yarn --frozen-lockfile --network-timeout 100000
- uses: ledgerhq/actions/get-package-infos@v2.0.0
id: version
- name: set beta name
Expand Down Expand Up @@ -222,7 +223,7 @@ jobs:
- name: install dependencies
env:
JOBS: max
run: yarn --frozen-lockfile
run: yarn --frozen-lockfile --network-timeout 100000
- uses: ledgerhq/actions/get-package-infos@v2.0.0
id: version
- name: set beta name
Expand Down
159 changes: 0 additions & 159 deletions .github/workflows/checks.yml

This file was deleted.

Loading

0 comments on commit 43eb6e5

Please sign in to comment.