fix: adaptive cypress 6 intercept method
This commit is contained in:
parent
f8e332dfa3
commit
acc6abfb54
|
|
@ -1,9 +1,8 @@
|
|||
describe('View the homepage', () => {
|
||||
beforeEach(() => {
|
||||
cy.server()
|
||||
cy.route2('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.route2('GET', /articles/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.route2('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
cy.intercept('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.intercept('GET', /articles/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.intercept('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
|
||||
cy.visit('/')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
describe('test for like-follow', () => {
|
||||
beforeEach(() => {
|
||||
cy.server()
|
||||
cy.route2('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.route2('GET', /articles\?/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.route2('GET', /articles\//, { fixture: 'article.json' }).as('getArticle')
|
||||
cy.route2('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
cy.intercept('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.intercept('GET', /articles\?/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.intercept('GET', /articles\//, { fixture: 'article.json' }).as('getArticle')
|
||||
cy.intercept('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
|
||||
cy.visit('/')
|
||||
})
|
||||
|
|
@ -17,7 +16,7 @@ describe('test for like-follow', () => {
|
|||
.should('contain', 'login')
|
||||
|
||||
cy.get('h1.text-xs-center')
|
||||
.should('contain.text', ' Sign in ')
|
||||
.should('contain.text', 'Sign in')
|
||||
})
|
||||
|
||||
it('login:like articles', () => {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
describe('test for login', () => {
|
||||
beforeEach(() => {
|
||||
cy.server()
|
||||
cy.route2('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.route2('GET', /articles\?/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.route2('GET', /articles\//, { fixture: 'article.json' }).as('getArticle')
|
||||
cy.route2('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
cy.intercept('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.intercept('GET', /articles\?/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.intercept('GET', /articles\//, { fixture: 'article.json' }).as('getArticle')
|
||||
cy.intercept('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
|
||||
cy.visit('/')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
describe('test for register', () => {
|
||||
beforeEach(() => {
|
||||
cy.server()
|
||||
cy.route2('POST', /users/, { fixture: 'register.json' }).as('register')
|
||||
cy.route2('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.route2('GET', /articles\?/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.route2('GET', /articles\//, { fixture: 'article.json' }).as('getArticle')
|
||||
cy.route2('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
cy.intercept('POST', /users/, { fixture: 'register.json' }).as('register')
|
||||
cy.intercept('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.intercept('GET', /articles\?/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.intercept('GET', /articles\//, { fixture: 'article.json' }).as('getArticle')
|
||||
cy.intercept('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
|
||||
cy.visit('/')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
describe('test for tag', () => {
|
||||
beforeEach(() => {
|
||||
cy.server()
|
||||
cy.route2('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.route2('GET', /articles/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.route2('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
cy.intercept('GET', /articles\?tag=butt/, { fixture: 'article_of_tag' }).as('article_of_tag')
|
||||
cy.intercept('GET', /articles/, { fixture: 'articles.json' }).as('getArticles')
|
||||
cy.intercept('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
|
||||
|
||||
cy.visit('/')
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue