mysterious-sandwich-43667
07/15/2022, 7:52 PMfamous-restaurant-30435
07/15/2022, 7:59 PMmysterious-sandwich-43667
07/15/2022, 8:01 PMmysterious-sandwich-43667
07/15/2022, 8:04 PMfamous-restaurant-30435
07/15/2022, 9:43 PMfamous-restaurant-30435
07/15/2022, 9:43 PMmysterious-sandwich-43667
07/16/2022, 1:39 AMmysterious-sandwich-43667
07/16/2022, 1:40 AMmysterious-sandwich-43667
07/16/2022, 1:41 AMmysterious-sandwich-43667
07/16/2022, 1:56 AMlively-guitar-99977
07/16/2022, 12:18 PMlively-guitar-99977
07/16/2022, 1:17 PMname: Cypress Tests
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install
run: npm i --force
- name: Build
run: npm run build --force
- name: Run React and Cypress
run: npm run start & npm run cypress:run
mysterious-sandwich-43667
07/16/2022, 1:35 PMfamous-restaurant-30435
07/16/2022, 6:24 PMmysterious-sandwich-43667
07/16/2022, 6:38 PMbillowy-hairdresser-82846
07/17/2022, 7:33 AMbillowy-hairdresser-82846
07/17/2022, 7:33 AMaloof-jordan-11481
07/17/2022, 1:07 PMquasar dev -m pwa
and let Cypress use it. Some of my tests always fail if I start the server with npx http-server
. The failing tests validate whether certain API calls are made so nothing special really.
let notoSansCount = 0;
cy.intercept('**/NotoSans-Regular*.TTF', (req) => {
notoSansCount += 1;
req.continue();
}).as('notoSansRegular');
cy.visit('/');
// this call is never made if I run it in http-server
// this works reliably with quasar dev
cy.wait('@notoSansRegular');
cy.dataCy('language-selection').then(() =>
expect(notoSansCount).to.equal(1)
);
wonderful-match-15836
07/17/2022, 6:10 PMloginPageHeaderText
method to get the element.
cy.shouldContain(loginPage.loginPageHeaderText, 'Welcome')
should be:
cy.shouldContain(loginPage.loginPageHeaderText(), 'Welcome')
rhythmic-fall-53545
07/17/2022, 7:08 PMadorable-smartphone-87280
07/17/2022, 7:28 PMcypress.config.ts
file.rhythmic-fall-53545
07/17/2022, 7:32 PMadorable-smartphone-87280
07/17/2022, 7:35 PMadorable-smartphone-87280
07/17/2022, 7:37 PM--env testenv=1
and then have logic like:adorable-smartphone-87280
07/17/2022, 7:38 PMif (config.env.testenv) {
return {
config: property
}
} else return {
default config
}
adorable-smartphone-87280
07/17/2022, 7:38 PMcypress.config.ts
able-magazine-89300
07/17/2022, 8:19 PMable-magazine-89300
07/17/2022, 8:20 PMwonderful-match-15836
07/17/2022, 8:42 PMhandsome-dress-30825
07/18/2022, 9:47 AMcy.session
command
I don't explicitly logout the user between tests from the same spec file (I am still using Cypress version 9.7.0) and the login credentials that are passed to the session command are different than the previous ones (I see it in the command logs as well). However the command proceeds to the validate
method to check if the session is valid, even though the user credentials were different. In the validate
method I use expect().to.be.false
type of validations to check if the token is still valid and since we do have a valid token it proceeds to use the previous user instead of logging in with the new one.
Has anyone encountered such an issue and how did you handle it?