tests: fix nginx setup
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
parent
2a61366bcf
commit
a8a34dbd70
@ -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:
|
||||||
|
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', () => {
|
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 !");
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user