-
Notifications
You must be signed in to change notification settings - Fork 8
Selenium Work flow enhancements #4065
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
base: development
Are you sure you want to change the base?
Changes from 2 commits
ec50ef0
6c4fc38
6c76dd6
eb49c47
bee5702
20ba723
d13f8c8
aa1e941
0a3ce83
49c7eb6
4499676
2b5a8c3
5a7b0c9
ffb01f6
249b528
7d9a2a9
01b1d7f
02ec2c1
e433efc
866d15d
a852a3d
eca183b
d313e5f
52e4a30
d57645b
b84de32
6c5b3f3
d3dac8c
e5bd3e4
c4a0be9
9bf7a40
cbf78ea
169a685
f3a82e5
076c6f1
77e12e5
8fd7e10
9dae3e2
668942f
b4f0fd0
1ebf141
430fa6c
7632715
0ab59b3
6b6ba4e
da31eb2
6c91ead
dcf3ca8
2321878
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,38 +2,77 @@ name: Playground Selenium Tests | |
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: "Select which Git branch to run against" | ||
required: true | ||
default: "development" | ||
network: | ||
description: "Select the target environment" | ||
required: true | ||
type: choice | ||
default: "dev" | ||
options: | ||
- local | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do a local lerna build and run locally; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, but it's not a network cause the local server could run against dev, qa, test, and main nets. Also, the branch option will only run the tests from this branch, but the source code will be based on the deployed website. So IMO, we should always run the server locally with the preferred network. here is the guide to switch the network https://github.com/threefoldtech/tfgrid-sdk-ts/blob/development/packages/playground/docs/build.md#run-the-script There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what we can do is but for other networks don't see the point of that; but will keep your point only for nightly run on local build. |
||
- dev | ||
- qa | ||
- test | ||
- main | ||
schedule: | ||
- cron: "0 6 * * *" | ||
|
||
jobs: | ||
selenium-run: | ||
runs-on: ubuntu-latest | ||
env: | ||
NETWORK: ${{ github.event.inputs.network }} | ||
|
||
steps: | ||
- name: Checkout | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setting up Python | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Installing all necessary packages | ||
run: pip install -r packages/playground/tests/frontend_selenium/requirements.txt | ||
- name: Node install | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pip install -r packages/playground/tests/frontend_selenium/requirements.txt | ||
pip install pytest-html | ||
|
||
- name: Set up Node.js 18 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Yarn install | ||
run: yarn install | ||
- name: Lerna Build | ||
run: yarn lerna run build | ||
- name: Yarn Serve | ||
node-version: "18" | ||
|
||
- name: Install JS dependencies & build | ||
if: ${{ github.event.inputs.network == 'local' }} | ||
run: | | ||
yarn install | ||
yarn lerna run build | ||
|
||
- name: Start playground server | ||
run: make run project=playground & | ||
- name: Wait for localhost | ||
|
||
- name: Wait for server to be ready | ||
run: sleep 60 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All these steps for running the local server, and only the install step has the condition There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes these steps are needed only for launch the dashboard locally; instead of this in all other network we just use the dashboard URL. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed with Hanafy and Team; to add a flag to be used if want a local build against any specific network, and by default the nightly workflow will run against staging env. |
||
- name: Run tests | ||
|
||
- name: Run Selenium tests | ||
working-directory: ./packages/playground/tests/frontend_selenium | ||
env: | ||
TFCHAIN_MNEMONICS: ${{ secrets.TFCHAIN_MNEMONICS }} | ||
TFCHAIN_NODE_MNEMONICS: ${{ secrets.TFCHAIN_NODE_MNEMONICS }} | ||
STELLAR_ADDRESS: ${{ secrets.STELLAR_ADDRESS }} | ||
EMAIL: ${{ secrets.EMAIL }} | ||
run: python -m pytest -v | ||
NETWORK: ${{ env.NETWORK }} | ||
run: | | ||
python -m pytest -v --html=report.html | ||
|
||
- name: Upload HTML report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: selenium-report-${{ env.NETWORK }} | ||
path: packages/playground/tests/frontend_selenium/report.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets unify our messages and use the same message like grid nigtly
"Use workflow from"