tests: fix nginx setup

This commit is contained in:
SPT-dev 2023-03-02 21:13:00 -05:00
parent 8e87f8bc3a
commit 64848518c8
3 changed files with 17 additions and 1 deletions

View File

@ -49,6 +49,7 @@ steps:
image: nginx:1.21.4-alpine image: nginx:1.21.4-alpine
commands: commands:
- cp -r ./items/frontend/build/* /usr/share/nginx/html - cp -r ./items/frontend/build/* /usr/share/nginx/html
- cp ./items/frontend/src/cypress/fixtures/default.conf /etc/nginx/conf.d/default.conf
- nginx -g "daemon off;" - nginx -g "daemon off;"
detach: true detach: true
depends_on: depends_on:

View File

@ -0,0 +1,15 @@
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@ -39,7 +39,7 @@ describe('Url check', () => {
describe('Check page not found', () => { describe('Check page not found', () => {
it('Invalid url should redirect to page not found', () => { it('Invalid url should redirect to page not found', () => {
cy.visit('/ABC', {failOnStatusCode: false}).its('status').should('equal', 404) cy.visit('/ABC')
cy.get('#not-found-message').contains("This page does not exist !"); cy.get('#not-found-message').contains("This page does not exist !");
}) })
}) })