返回 slidev
smoke.spec.ts
根目录 / cypress / e2e / examples / smoke.spec.ts
1 context('Smoke test', () => {
2 async function testAllSlides() {
3 while (1) {
4 let oldUrl, newUrl
5 cy.get('body')
6 .url()
7 .then(url => (oldUrl = url))
8 .type(`{RightArrow}`)
9 .wait(1000)
10 .url()
11 .then(url => (newUrl = url))
12 if (oldUrl === newUrl)
13 break
14 }
15 }
16
17 it('should throw no error in Play mode', async () => {
18 cy.visit('/').wait(4000)
19 await testAllSlides()
20 })
21
22 it('should throw no error in Presenter mode', async () => {
23 cy.visit('/presenter').wait(4000)
24 await testAllSlides()
25 })
26
27 it('should throw no error in Overview page', async () => {
28 cy.visit('/overview').wait(4000)
29 })
30
31 it('should throw no error in Entry page', async () => {
32 cy.visit('/entry').wait(4000)
33 })
34 })
35
35 lines TYPESCRIPT