tests: fix nginx setup
This commit is contained in:
parent
8e87f8bc3a
commit
64848518c8
@ -49,6 +49,7 @@ steps:
|
||||
image: nginx:1.21.4-alpine
|
||||
commands:
|
||||
- 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;"
|
||||
detach: true
|
||||
depends_on:
|
||||
|
15
items/frontend/src/cypress/fixtures/default.conf
Normal file
15
items/frontend/src/cypress/fixtures/default.conf
Normal 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;
|
||||
}
|
||||
}
|
@ -39,7 +39,7 @@ describe('Url check', () => {
|
||||
|
||||
describe('Check 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 !");
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user