diff --git a/.github/workflows/playground_selenium.yaml b/.github/workflows/playground_selenium.yaml index 8d801a3577..1312e6996d 100644 --- a/.github/workflows/playground_selenium.yaml +++ b/.github/workflows/playground_selenium.yaml @@ -2,12 +2,25 @@ name: Playground Selenium Tests on: workflow_dispatch: + inputs: + env: + type: choice + description: "Target environment" + required: true + default: "dev" + options: + - "dev" + - "qa" + - "test" + - "main" schedule: - cron: "0 6 * * *" jobs: selenium-run: runs-on: ubuntu-latest + env: + ENV: ${{ github.event.inputs.env || 'dev' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -25,11 +38,16 @@ jobs: node-version: 22.15 - name: Yarn install run: yarn install + - name: Set environment + run: sed -i "s/^net = .*/net = $ENV/" packages/playground/tests/frontend_selenium/Config.ini - name: Lerna Build + if: ${{ env.ENV == 'dev' }} run: yarn lerna run build - name: Yarn Serve + if: ${{ env.ENV == 'dev' }} run: make run project=playground & - name: Wait for localhost + if: ${{ env.ENV == 'dev' }} run: sleep 60 - name: Run tests working-directory: ./packages/playground/tests/frontend_selenium @@ -38,4 +56,10 @@ jobs: TFCHAIN_NODE_MNEMONICS: ${{ secrets.TFCHAIN_NODE_MNEMONICS }} STELLAR_ADDRESS: ${{ secrets.STELLAR_ADDRESS }} EMAIL: ${{ secrets.EMAIL }} - run: python -m pytest -v + run: python -m pytest -v --html=report.html + - name: Upload test report + if: success() || failure() + uses: actions/upload-artifact@v4 + with: + name: selenium-report-${{ env.ENV }} + path: packages/playground/tests/frontend_selenium/report.html diff --git a/packages/playground/tests/frontend_selenium/Config.ini b/packages/playground/tests/frontend_selenium/Config.ini deleted file mode 100644 index da06d9ce46..0000000000 --- a/packages/playground/tests/frontend_selenium/Config.ini +++ /dev/null @@ -1,8 +0,0 @@ -[Base] -port = 5173 -net = local -[Utils] -seed = -node_seed = -address = -email = \ No newline at end of file diff --git a/packages/playground/tests/frontend_selenium/selenium.md b/packages/playground/tests/frontend_selenium/selenium.md index 0ed954b819..d76ccaedcb 100644 --- a/packages/playground/tests/frontend_selenium/selenium.md +++ b/packages/playground/tests/frontend_selenium/selenium.md @@ -28,7 +28,8 @@ There are two ways to run the Automation selenium tests: yarn lerna run build make run project=playground ``` -If the build fails due to a memory issue, please use the following command + + If the build fails due to a memory issue, please use the following command ```bash export NODE_OPTIONS="--max-old-space-size=8192" @@ -70,17 +71,17 @@ export NODE_OPTIONS="--max-old-space-size=8192" - (Not Recommended) Install the recommended version of the pip package listed above for a stable run, or you can just install Python 3 and use the command: - `pip install -r requirements.txt --break-system-packages` (Use this if you don't use any of the listed packages). -- (Recommended) Or use Virtual Environments: - - create an environment using - `python -m venv myenv` +- (Recommended) Or use Virtual Environments: + - create an environment using + `python -m venv myenv` - activate it using - `source myenv/bin/activate` + `source myenv/bin/activate` - install packages using - `pip install -r requirements.txt`. + `pip install -r requirements.txt`. - You'll also need to install `Xvfb`, Run: - `sudo apt install xvfb`. + `sudo apt install xvfb`. - You can run selenium tests with pytest through the command line using: - `python3 -m pytest -v`. + `python3 -m pytest -v`. ### More options to run tests