Skip to content

Commit

Permalink
Merge branch 'master' into game_historic_service
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosBarrilVillaverde committed May 1, 2024
2 parents 110d0d1 + 4b7bc32 commit cd5db09
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 10 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
- run: npm --prefix storeQuestionService ci
- run: npm --prefix userStatsService ci
- run: npm --prefix gameservice ci
- run: npm --prefix gameservice ci
- run: npm --prefix apisgatewayservice ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
Expand All @@ -36,4 +35,18 @@ jobs:
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
e2e-tests:
needs: [unit-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm --prefix users/authservice install
- run: npm --prefix users/userservice install
- run: npm --prefix gatewayservice install
- run: npm --prefix webapp install
- run: npm --prefix webapp run build
- run: npm --prefix webapp run test:e2e
32 changes: 27 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
- run: npm --prefix webapp ci
- run: npm --prefix gameservice ci
- run: npm --prefix apisgatewayservice ci
- run: npm --prefix apisgatewayservice ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
- run: npm --prefix webapp test -- --coverage
- run: npm --prefix storeQuestionService test -- --coverage
- run: npm --prefix userStatsService test -- --coverage
- run: npm --prefix apisgatewayservice test -- --coverage
#- run: npm --prefix gameservice test -- --coverage
- run: npm --prefix gameservice test -- --coverage


- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
Expand Down Expand Up @@ -150,7 +150,8 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: questionsservice/questiongeneratorservice
workdir: questionsservice
dockerfile: ./questiongeneratorservice/Dockerfile
platforms: linux/arm64
docker-push-wikidataextractorservice:
name: Push wikidata extractor service Docker Image to GitHub Packages
Expand All @@ -170,7 +171,8 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: questionsservice/wikidataExtractor
workdir: questionsservice
dockerfile: ./wikidataExtractor/Dockerfile
platforms: linux/arm64
docker-push-storequestionservice:
name: Push questions store service Docker Image to GitHub Packages
Expand Down Expand Up @@ -243,6 +245,26 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es6c/apisgatewayservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: apisgatewayservice
platforms: linux/arm64
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
Expand Down
12 changes: 9 additions & 3 deletions webapp/e2e/steps/register-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,27 @@ defineFeature(feature, test => {

let username;
let password;
let name;
let surname;

given('An unregistered user', async () => {
username = "pablo"
username = name = "pablo"
surname = "gonzález"
password = "pabloasw"
await expect(page).toClick("p", { text: "Don't have an account? Register here." });
});

when('I fill the data in the form and press submit', async () => {
await expect(page).toFill('input[name="username"]', username);
await expect(page).toFill('input[name="password"]', password);
await expect(page).toClick('button', { text: 'Add user' })
await expect(page).toFill('input[name="confirmPassword"]', password);
await expect(page).toFill('input[name="name"]', name);
await expect(page).toFill('input[name="surname"]', surname);
await expect(page).toClick('button', { text: 'Añadir' })
});

then('A confirmation message should be shown in the screen', async () => {
await expect(page).toMatchElement("div", { text: "User added successfully" });
await expect(page).toMatchElement("div", { text: "Usuario añadido correctamente" });
});
})

Expand Down
2 changes: 2 additions & 0 deletions webapp/src/components/game/Calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ const Calculator = () => {
case '÷':
correctAnswer = Math.round(num1 / num2);
break;
default:
break;
}

const option = [correctAnswer];
Expand Down

0 comments on commit cd5db09

Please sign in to comment.