-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
97 changed files
with
7,077 additions
and
5,120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Generate Reports | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
issues: | ||
types: [opened, deleted, closed, reopened, labeled] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
generate-reports: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install matplotlib pandas requests PyGithub | ||
- name: Check environment variables | ||
env: | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
USER: ${{ secrets.USER }} | ||
PROJECT: ${{ secrets.PROJECT }} | ||
run: | | ||
echo "User secret length: ${#USER}" | ||
echo "Project secret length: ${#PROJECT}" # Changed the checks for user and project to length checks (these secrets should probably be changed to variables) | ||
echo "Token length: ${#ACCESS_TOKEN}" # This will print the length of the token to ensure it's set, without exposing it. | ||
- name: Run report generation script | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} #This should work instead of using a personal access token | ||
USER: ${{ secrets.USER }} | ||
PROJECT: ${{ secrets.PROJECT }} | ||
run: python ishikawa_tools/ishikawa_tools_script.py | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ishikawa-screenshots | ||
path: ./ishikawa_tools/output | ||
retention-days: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Playwright Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: Build and start services | ||
run: docker-compose up -d --build | ||
|
||
- name: Wait for container to become available | ||
run: | | ||
npx wait-on http://localhost:8080 | ||
sleep 30 # Aumenta el tiempo de espera adicional para asegurarte de que el servidor está listo | ||
- name: Check Docker logs | ||
run: docker-compose logs | ||
|
||
- name: Install npm dependencies | ||
run: npm ci | ||
|
||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run Playwright tests | ||
run: npx playwright test | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
|
||
- name: Stop services | ||
run: docker-compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"trailingComma": "all", | ||
"semi": false, | ||
"arrowParens": "always" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Etapa 1: Construcción | ||
FROM node:lts AS build-stage | ||
|
||
WORKDIR /app | ||
|
||
# Copiar y instalar dependencias | ||
COPY package*.json ./ | ||
RUN npm install | ||
|
||
# Copiar el resto de la aplicación y construir | ||
COPY . . | ||
RUN npm run build-dev | ||
|
||
# Etapa 2: Producción y Pruebas | ||
FROM node:18 | ||
|
||
WORKDIR /app | ||
|
||
# Instalar 'serve' y 'wait-on' para servir la aplicación y esperar a que esté lista | ||
RUN npm install -g serve wait-on | ||
|
||
# Copiar la aplicación construida desde la etapa de construcción | ||
COPY --from=build-stage /app/dist /app | ||
|
||
# Copiar y instalar dependencias necesarias para Playwright | ||
COPY package*.json ./ | ||
RUN npx playwright install --with-deps | ||
RUN npm install @playwright/test -D | ||
|
||
# Copiar la configuración de Playwright y el resto de la aplicación | ||
COPY playwright.config.js . | ||
COPY . . | ||
|
||
# Exponer el puerto en el que se servirá la aplicación | ||
EXPOSE 5000 | ||
|
||
# Ejecutar la aplicación y esperar a que esté disponible antes de ejecutar las pruebas | ||
CMD ["sh", "-c", "serve -s . -l 5000 & wait-on http://localhost:5000 && npx playwright test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
const { defineConfig } = require("cypress"); | ||
const { defineConfig } = require('cypress') | ||
require('dotenv').config() | ||
|
||
module.exports = defineConfig({ | ||
projectId: 'xmf2jf', | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
}, | ||
}); | ||
env: { | ||
// add environment variables here | ||
...process.env, | ||
url: 'http://localhost:8080', | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const authUser = require('../fixtures/authUser.json') | ||
const url = Cypress.env('url') | ||
|
||
describe('Authentication Suite', () => { | ||
describe('Registration', () => { | ||
it('should allow a new user to register', () => { | ||
cy.visit(url + '/signup') | ||
const { email, password } = authUser | ||
cy.get('form').findByLabelText(/e-mail/i).type(email) | ||
cy.get('form').findByLabelText("Password").type(password) | ||
cy.get('form').findByLabelText("Confirm your password").type(password) | ||
cy.findByRole('button', {name: 'Sign-up'}).click() | ||
cy.wait(500) | ||
cy.contains(email) | ||
cy.deleteUser(email, password) | ||
}) | ||
it('should reject registration with invalid password', () => { | ||
cy.visit(url + '/signup') | ||
const { email, invalidPassword } = authUser | ||
cy.get('form').findByLabelText(/e-mail/i).type(email) | ||
cy.get('form').findByLabelText("Password").type(invalidPassword) | ||
cy.get('form').findByLabelText("Confirm your password").type(invalidPassword) | ||
cy.findByRole('button', {name: 'Sign-up'}).click() | ||
cy.contains('Password must be at least 6 characters') | ||
}) | ||
it('should reject registration when passwords do not match', () => { | ||
cy.visit(url + '/signup') | ||
const { email, password, invalidPassword } = authUser | ||
cy.get('form').findByLabelText(/e-mail/i).type(email) | ||
cy.get('form').findByLabelText("Password").type(password) | ||
cy.get('form').findByLabelText("Confirm your password").type(invalidPassword) | ||
cy.findByRole('button', {name: 'Sign-up'}).click() | ||
cy.contains('Different passwords') | ||
}) | ||
}) | ||
describe('Login', () => { | ||
const { email, password } = authUser | ||
beforeEach(() => { | ||
cy.signup(email, password) | ||
cy.logout() | ||
cy.visit(url + '/signin') | ||
}) | ||
afterEach(() => { | ||
cy.deleteUser(email, password) | ||
}) | ||
it('should allow a registered user to login', () => { | ||
cy.get('form').findByLabelText(/e-mail/i).type(email) | ||
cy.get('form').findByLabelText('Password').type(password) | ||
cy.findByTestId('sign-in-button').click() | ||
cy.wait(500) | ||
cy.contains(email) | ||
}) | ||
it('should reject login with incorrect password', () => { | ||
const { email, password, invalidPassword } = authUser | ||
cy.get('form').findByLabelText(/e-mail/i).type(email) | ||
cy.get('form').findByLabelText('Password').type(invalidPassword) | ||
cy.findByTestId('sign-in-button').click() | ||
cy.contains('Incorrect password') | ||
}) | ||
it('should reject login with unregistered email', () => { | ||
cy.get('form').findByLabelText(/e-mail/i).type('[email protected]') | ||
cy.get('form').findByLabelText('Password').type('noexist') | ||
cy.findByTestId('sign-in-button').click() | ||
cy.contains('Incorrect username or password') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const heuristic = require('../fixtures/heuristic.json') | ||
const authUser = require('../fixtures/authUser.json') | ||
|
||
const url = Cypress.env('url') | ||
const { email, password } = authUser | ||
|
||
describe('Heuristic test Suite', () => { | ||
before('Signup into the app', () => { | ||
cy.deleteUser(email, password) | ||
cy.signup(email, password) | ||
cy.login(email, password) | ||
}) | ||
after('Remove user', () => { | ||
cy.deleteUser(email, password) | ||
}) | ||
describe('Create Heuristic Test', () => { | ||
it('should allow a new test to create', () => { | ||
cy.visit(url + '/testslist') | ||
cy.findByTestId('create-test-btn').click() | ||
cy.findByText('Create a blank test').click() | ||
cy.findByText('Usability Heuristic').click() | ||
|
||
const { name, description } = heuristic | ||
cy.findByLabelText(/Test name/i).type(name) | ||
cy.findByLabelText(/Test Description/i).type(description) | ||
cy.findByTestId('add-name-test-creation-btn').click() | ||
|
||
cy.contains(/Manager/i) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"email": "[email protected]", | ||
"password": "ruxailab1234", | ||
"invalidPassword": "123", | ||
"data": { | ||
"accessLevel": 1, | ||
"email" : "[email protected]", | ||
"myAnswers": {}, | ||
"myTests": {}, | ||
"notifications": [] | ||
}, | ||
"collection": "users" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "Heuristic Test", | ||
"description": "This is a test of the heuristic test" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.