Skip to content

Commit

Permalink
test: try. The local test is passed, what is the problem with the onl…
Browse files Browse the repository at this point in the history
…ine test
  • Loading branch information
Linkontoask committed Dec 25, 2020
1 parent 575210a commit e1fad8d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
if: always()
with:
name: test-results
path: tests/e2e
path: tests


build:
Expand Down
54 changes: 27 additions & 27 deletions tests/e2e/integration/news.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,6 @@ context('News Music Basic', () => {
cy.contains('.active-tag', '华语')
})

it('Double click to play the song', () => {
cy.visit('/music/toplist')

// https://github.com/cypress-io/cypress/issues/14269
// Found it is a cache problem
// Solution: Use a timestamp to ensure that the URL cannot hit the browser cache
cy.intercept(/\/api\/song\/url/).as('getUrl')
cy.intercept(/\/api\/song\/detail/).as('getDetail')
cy.intercept(/\/api\/lyric/).as('getLyric')
cy.get(
'.toplist-expansion-contanier:first-child .none-select:first-child'
).dblclick()

cy.wait(['@getUrl', '@getDetail', '@getLyric'], {
requestTimeout: 20 * 1000
}).then(() => {
cy.get('source')
.invoke('attr', 'src')
.then(src => {
expect(src).to.have.string('.mp3')
})

// pause music
cy.get('.music-command-group button:nth-child(3)').click()
})
})

it('Singer filter', () => {
cy.visit('/music/artists')
cy.get('.artists-content ul')
Expand Down Expand Up @@ -114,4 +87,31 @@ context('News Music Basic', () => {

cy.contains('.secondary-bar-link-active', '专辑')
})

it('Double click to play the song', () => {
cy.visit('/music/toplist')

// https://github.com/cypress-io/cypress/issues/14269
// Found it is a cache problem
// Solution: Use a timestamp to ensure that the URL cannot hit the browser cache
cy.intercept(/\/api\/song\/url/).as('getUrl')
cy.intercept(/\/api\/song\/detail/).as('getDetail')
cy.intercept(/\/api\/lyric/).as('getLyric')
cy.get(
'.toplist-expansion-contanier:first-child .none-select:first-child'
).dblclick()

cy.wait(['@getUrl', '@getDetail', '@getLyric'], {
requestTimeout: 20 * 1000
}).then(() => {
cy.get('source')
.invoke('attr', 'src')
.then(src => {
expect(src).to.have.string('.mp3')
})

// pause music
cy.get('.music-command-group button:nth-child(3)').click()
})
})
})

0 comments on commit e1fad8d

Please sign in to comment.