Skip to content

Commit

Permalink
agregado tb el nuevo e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed Apr 30, 2024
1 parent f7b1427 commit 80510c2
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 22 deletions.
48 changes: 26 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,34 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

e2e-tests:
needs: [unit-tests]
name: Execute E2Etests
runs-on: ubuntu-latest

needs: [docker-push-userservice,docker-push-authservice,docker-push-questionservice,docker-push-historyservice,docker-push-gatewayservice,docker-push-webapp,docker-push-roomservice]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Executing E2E tests
uses: fifsky/ssh-action@master
with:
node-version: 20
- run: npm --prefix users/authservice install
- run: npm --prefix users/userservice install
- run: npm --prefix gatewayservice install
- run: npm --prefix historyservice install
- run: npm --prefix questionservice install
- run: npm --prefix roomservice install
- run: npm --prefix webapp install
- run: npm --prefix webapp run build
- run: npm --prefix webapp run test:e2e
env :
CI : ""
host: ${{ secrets.DEPLOY_HOST }}
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
cd wiq_es05
export GITHUB_ACTIONS=true
echo "The value of GITHUB ACTIONS is: $GITHUB_ACTIONS"
npm --prefix users/authservice install
npm --prefix users/userservice install
npm --prefix gatewayservice install
npm --prefix historyservice install
npm --prefix questionservice install
npm --prefix roomservice install
npm --prefix webapp install
npm --prefix webapp run build
chmod +x ./scripts/waitforSUT.sh
docker compose --profile prod up -d --pull always
./scripts/waitforSUT.sh
npm --prefix webapp run test:e2e
docker-push-roomservice:
Expand All @@ -55,7 +65,7 @@ jobs:
permissions:
contents: read
packages: write
needs: [e2e-tests]

steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -76,7 +86,6 @@ jobs:
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -98,7 +107,6 @@ jobs:
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -116,7 +124,6 @@ jobs:
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -134,7 +141,6 @@ jobs:
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -152,7 +158,6 @@ jobs:
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand All @@ -170,7 +175,6 @@ jobs:
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
Expand Down
1 change: 1 addition & 0 deletions webapp/e2e/steps/basicButtons-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let browser;
defineFeature(feature, test => {

beforeAll(async () => {
console.log('Starting Puppeteer basicButton... githubactyions.env', process.env.GITHUB_ACTIONS);
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20 });
Expand Down
2 changes: 2 additions & 0 deletions webapp/e2e/steps/dailyQuestionMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ let browser;
defineFeature(feature, test => {

beforeAll(async () => {
console.log('Starting Puppeteer dailyMode... githubactyions.env', process.env.GITHUB_ACTIONS);

browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20 });
Expand Down
2 changes: 2 additions & 0 deletions webapp/e2e/steps/gameBasicMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ let browser;
defineFeature(feature, test => {

beforeAll(async () => {
console.log('Starting Puppeteer gameBasic... githubactyions.env', process.env.GITHUB_ACTIONS);

browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20 });
Expand Down
2 changes: 2 additions & 0 deletions webapp/e2e/steps/login-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ let browser;
defineFeature(feature, test => {

beforeAll(async () => {
console.log('Starting Puppeteer login-form... githubactyions.env', process.env.GITHUB_ACTIONS);

browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 50 });
Expand Down
2 changes: 2 additions & 0 deletions webapp/e2e/steps/multiplayerMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ let browserUser;
defineFeature(feature, test => {

beforeAll(async () => {
console.log('Starting Puppeteer... githubactyions.env', process.env.GITHUB_ACTIONS);

browserHost = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20 });
Expand Down
2 changes: 2 additions & 0 deletions webapp/e2e/steps/register-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ let browser;
defineFeature(feature, test => {

beforeAll(async () => {
console.log('Starting Puppeteer... githubactyions.env', process.env.GITHUB_ACTIONS);

browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20 });
Expand Down

0 comments on commit 80510c2

Please sign in to comment.