Created
February 13, 2024 22:55
-
-
Save xiongemi/a2625d4e4b5c2220032d3401a18b4594 to your computer and use it in GitHub Desktop.
cats expo cypress tests
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
// apps/cats-cypress/cypress/e2e/app.cy.ts | |
import { getGreeting } from '../support/app.po'; | |
describe('Should display a cat fact', () => { | |
beforeEach(() => { | |
cy.intercept('https://catfact.ninja/fact', { | |
fixture: 'cat-fact-response.json', | |
}).as('getCatsFact'); | |
cy.visit('/'); | |
cy.wait(['@getCatsFact']); | |
}); | |
it('should display title', () => { | |
// Function helper example, see `../support/app.po.ts` file | |
getGreeting().contains(/Cat Facts/); | |
}); | |
it('should display a cat fact', () => { | |
cy.get('[data-testid="carousel-card-content"]').contains( | |
'A cat\u2019s heart beats nearly twice as fast as a human heart, at 110 to 140 beats a minute.' | |
); | |
}); | |
}); |
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
{ | |
"fact": "A cat\u2019s heart beats nearly twice as fast as a human heart, at 110 to 140 beats a minute.", | |
"length": 88 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment