fix cypress tests to properly select in children
This commit is contained in:
parent
bdf386e510
commit
b12d0fc7d3
1 changed files with 12 additions and 12 deletions
|
|
@ -31,18 +31,18 @@ describe('The admin text detail page', () => {
|
|||
})
|
||||
|
||||
it('clicking "Add child" reveals an inline form', () => {
|
||||
cy.get('#text-detail li').first().find('button.add-child').click()
|
||||
cy.get('#text-detail li').first().find('input.child-title').should('be.visible')
|
||||
cy.get('#text-detail li').first().find('button.save-child').should('be.visible')
|
||||
cy.get('#text-detail li').first().children('button.add-child').click()
|
||||
cy.get('#text-detail li').first().children('input.child-title').should('be.visible')
|
||||
cy.get('#text-detail li').first().children('button.save-child').should('be.visible')
|
||||
})
|
||||
|
||||
it('can add a child to the root node', () => {
|
||||
cy.intercept('POST', '/api/nodes').as('createNode')
|
||||
cy.intercept('GET', '/api/nodes/0').as('getNodesRefresh')
|
||||
|
||||
cy.get('#text-detail > ul > li').first().find('button.add-child').click()
|
||||
cy.get('#text-detail > ul > li').first().find('input.child-title').type('New Child Node')
|
||||
cy.get('#text-detail > ul > li').first().find('button.save-child').click()
|
||||
cy.get('#text-detail > ul > li').first().children('button.add-child').click()
|
||||
cy.get('#text-detail > ul > li').first().children('input.child-title').type('New Child Node')
|
||||
cy.get('#text-detail > ul > li').first().children('button.save-child').click()
|
||||
|
||||
cy.wait('@createNode').its('response.statusCode').should('eq', 201)
|
||||
cy.wait('@getNodesRefresh')
|
||||
|
|
@ -54,9 +54,9 @@ describe('The admin text detail page', () => {
|
|||
cy.intercept('POST', '/api/nodes').as('createNode')
|
||||
cy.intercept('GET', '/api/nodes/0').as('getNodesRefresh')
|
||||
|
||||
cy.get('#text-detail > ul > li > ul > li').first().find('button.add-child').click()
|
||||
cy.get('#text-detail > ul > li > ul > li').first().find('input.child-title').type('Nested Child Node')
|
||||
cy.get('#text-detail > ul > li > ul > li').first().find('button.save-child').click()
|
||||
cy.get('#text-detail > ul > li > ul > li').first().children('button.add-child').click()
|
||||
cy.get('#text-detail > ul > li > ul > li').first().children('input.child-title').type('Nested Child Node')
|
||||
cy.get('#text-detail > ul > li > ul > li').first().children('button.save-child').click()
|
||||
|
||||
cy.wait('@createNode').its('response.statusCode').should('eq', 201)
|
||||
cy.wait('@getNodesRefresh')
|
||||
|
|
@ -68,9 +68,9 @@ describe('The admin text detail page', () => {
|
|||
cy.intercept('POST', '/api/nodes').as('createNode')
|
||||
cy.intercept('GET', '/api/nodes/0').as('getNodesRefresh')
|
||||
|
||||
cy.get('#text-detail > ul > li').first().find('button.add-child').click()
|
||||
cy.get('#text-detail > ul > li').first().find('input.child-title').type('Persistent Child')
|
||||
cy.get('#text-detail > ul > li').first().find('button.save-child').click()
|
||||
cy.get('#text-detail > ul > li').first().children('button.add-child').click()
|
||||
cy.get('#text-detail > ul > li').first().children('input.child-title').type('Persistent Child')
|
||||
cy.get('#text-detail > ul > li').first().children('button.save-child').click()
|
||||
|
||||
cy.wait('@createNode')
|
||||
cy.wait('@getNodesRefresh')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue