2018-06-13 12:29:54 +00:00
|
|
|
describe('Taxonomy test', function () {
|
2018-04-10 19:38:27 +00:00
|
|
|
beforeEach(() => {
|
|
|
|
cy.loginByUI()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('clear DB', function(){
|
|
|
|
cy.clearDB()
|
|
|
|
})
|
|
|
|
|
|
|
|
context('CRUD Taxonomies', function(){
|
2018-06-13 12:29:54 +00:00
|
|
|
it('canceled create taxonomy', function(){
|
|
|
|
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/taxonomies')
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies')
|
|
|
|
//cy.get('#button-taxonomy-creation').click()
|
2018-04-10 19:38:27 +00:00
|
|
|
cy.get('.button').click()
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.location('hash').should('eq', '#/taxonomies/new')
|
|
|
|
cy.get('#tainacan-text-name').type('Taxonomy canceled')
|
|
|
|
cy.get('#tainacan-text-description').type('description taxonomy canceled')
|
2018-04-10 19:38:27 +00:00
|
|
|
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.get('#button-cancel-taxonomy-creation').click()
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies/')
|
2018-04-10 19:38:27 +00:00
|
|
|
cy.get('td').should('not.contain', 'Book canceled')
|
|
|
|
})
|
|
|
|
|
2018-06-13 12:29:54 +00:00
|
|
|
it('create taxonomy with status publish', function(){
|
|
|
|
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/taxonomies')
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies')
|
|
|
|
//cy.get('#button-taxonomy-creation').click()
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('.button').click()
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.location('hash').should('eq', '#/taxonomies/new')
|
|
|
|
cy.get('#tainacan-text-name').type('Taxonomy publish')
|
|
|
|
cy.get('#tainacan-text-description').type('description taxonomy publish')
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.get('#button-submit-taxonomy-creation').click()
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies/')
|
|
|
|
cy.get('td').should('contain', 'Taxonomy publish')
|
2018-04-12 21:21:32 +00:00
|
|
|
})
|
|
|
|
|
2018-06-13 12:29:54 +00:00
|
|
|
it('create taxonomy with status private', function(){
|
|
|
|
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/taxonomies')
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies')
|
|
|
|
//cy.get('#button-taxonomy-creation').click()
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('.button').click()
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.location('hash').should('eq', '#/taxonomies/new')
|
|
|
|
cy.get('#tainacan-text-name').type('Taxonomy private')
|
|
|
|
cy.get('#tainacan-text-description').type('description taxonomy private')
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('#tainacan-select-status').select('Private').should('have.value', 'private')
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.get('#button-submit-taxonomy-creation').click()
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies/')
|
|
|
|
cy.get('td').should('contain', 'Taxonomy private')
|
2018-04-12 21:21:32 +00:00
|
|
|
})
|
|
|
|
|
2018-06-13 12:29:54 +00:00
|
|
|
it('create taxonomy with status draft', function(){
|
|
|
|
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/taxonomies')
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies')
|
|
|
|
//cy.get('#button-taxonomy-creation').click()
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('.button').click()
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.location('hash').should('eq', '#/taxonomies/new')
|
|
|
|
cy.get('#tainacan-text-name').type('Taxonomy draft')
|
|
|
|
cy.get('#tainacan-text-description').type('description taxonomy draft')
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('#tainacan-select-status').select('Draft').should('have.value', 'draft')
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.get('#button-submit-taxonomy-creation').click()
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies/')
|
|
|
|
cy.get('td').should('not.contain', 'Taxonomy draft')
|
2018-04-12 21:21:32 +00:00
|
|
|
})
|
|
|
|
|
2018-06-13 12:29:54 +00:00
|
|
|
it('create taxonomy with status draft', function(){
|
|
|
|
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/taxonomies')
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies')
|
|
|
|
//cy.get('#button-taxonomy-creation').click()
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('.button').click()
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.location('hash').should('eq', '#/taxonomies/new')
|
|
|
|
cy.get('#tainacan-text-name').type('Taxonomy trash')
|
|
|
|
cy.get('#tainacan-text-description').type('description taxonomy trash')
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('#tainacan-select-status').select('Trash').should('have.value', 'trash')
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.get('#button-submit-taxonomy-creation').click()
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies/')
|
|
|
|
cy.get('td').should('not.contain', 'Taxonomy trash')
|
2018-04-12 21:21:32 +00:00
|
|
|
})
|
|
|
|
|
2018-06-13 12:29:54 +00:00
|
|
|
it('create taxonomy color', function(){
|
|
|
|
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/taxonomies')
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies')
|
|
|
|
//cy.get('#button-taxonomy-creation').click()
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('.button').click()
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.location('hash').should('eq', '#/taxonomies/new')
|
|
|
|
cy.get('#tainacan-text-name').type('Taxonomy color')
|
|
|
|
cy.get('#tainacan-text-description').type('description taxonomy color')
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.get('#button-submit-taxonomy-creation').click()
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies/')
|
|
|
|
cy.get('td').should('contain', 'Taxonomy color')
|
2018-04-12 21:21:32 +00:00
|
|
|
})
|
|
|
|
|
2018-06-13 12:29:54 +00:00
|
|
|
it('delete taxonomy color', function(){
|
|
|
|
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/taxonomies')
|
|
|
|
cy.location('hash').should('eq', '#/taxonomies')
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click()
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.get('.b-table').should('contain', 'Taxonomy trash')
|
2018-04-12 21:21:32 +00:00
|
|
|
cy.get(':nth-child(1) > [data-label="Actions"] > :nth-child(1) > #button-delete > .icon > .mdi').click()
|
|
|
|
cy.get('.modal-card').should('have.class', 'animation-content')
|
|
|
|
cy.get('.is-primary').click()
|
|
|
|
cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click()
|
2018-06-13 12:29:54 +00:00
|
|
|
cy.get('.b-table').should('not.contain', 'Taxonomy trash')
|
2018-04-12 21:21:32 +00:00
|
|
|
})
|
2018-04-10 19:38:27 +00:00
|
|
|
})
|
|
|
|
})
|