diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0f74ee4..43c25806 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -36,4 +35,18 @@ jobs: uses: sonarsource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + 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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b26d387b..e352a9da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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 @@ -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 @@ -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: diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index f940ed07..1757b5f3 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -27,9 +27,12 @@ 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." }); }); @@ -37,11 +40,14 @@ defineFeature(feature, test => { 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" }); }); }) diff --git a/webapp/src/components/game/Calculator.js b/webapp/src/components/game/Calculator.js index c259c06d..3b582cf5 100644 --- a/webapp/src/components/game/Calculator.js +++ b/webapp/src/components/game/Calculator.js @@ -104,6 +104,8 @@ const Calculator = () => { case '÷': correctAnswer = Math.round(num1 / num2); break; + default: + break; } const option = [correctAnswer];