starts the final tests for area fields within a collection
This commit is contained in:
parent
370691c479
commit
5cc4190f1b
|
@ -1,791 +0,0 @@
|
|||
describe('Fields text test', function () {
|
||||
beforeEach(() => {
|
||||
cy.loginByUI()
|
||||
})
|
||||
|
||||
it('clear DB', function(){
|
||||
cy.clearDB()
|
||||
})
|
||||
|
||||
it('create collection for create fields', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.contains('New Collection').click()
|
||||
cy.get('#tainacan-text-name').type('Book Fields')
|
||||
cy.get('#tainacan-text-description').type('Descrição book Fields')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-collection-creation').click()
|
||||
cy.get('#primary-menu > .menu > .menu-header > .menu-list > li > .router-link-active > .icon > .mdi').click()
|
||||
cy.get('.b-table').should('contain', 'Book Fields')
|
||||
})
|
||||
|
||||
context('create text-type fields', function(){
|
||||
it('canceled create text field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(1)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('Text name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'Text name canceled')
|
||||
})
|
||||
|
||||
it('create text field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(1)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('Text name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name public')
|
||||
})
|
||||
|
||||
it('create text field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(1)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('Text name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name private')
|
||||
})
|
||||
|
||||
it('create text field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(1)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('Text name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name public required')
|
||||
})
|
||||
|
||||
it('create text field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(1)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('Text name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name public multiple values')
|
||||
})
|
||||
|
||||
it('create text field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(1)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('Text name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'Text name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'Text name public unique values')
|
||||
})
|
||||
})
|
||||
|
||||
context('delete text-type fields', function(){
|
||||
it('delete fields created texts', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get(':nth-child(3) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
cy.get(':nth-child(4) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
cy.get(':nth-child(5) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
cy.get(':nth-child(6) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
cy.get(':nth-child(7) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
})
|
||||
})
|
||||
|
||||
context('create textArea-type fields', function(){
|
||||
it('canceled create textArea field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'TextArea name canceled')
|
||||
})
|
||||
|
||||
it('create textArea field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public')
|
||||
})
|
||||
|
||||
it('create textArea field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name private')
|
||||
})
|
||||
|
||||
it('create textArea field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public required')
|
||||
})
|
||||
|
||||
it('create textArea field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public multiple values')
|
||||
})
|
||||
|
||||
it('create textArea field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'Text name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public unique values')
|
||||
})
|
||||
})
|
||||
|
||||
context('delete textArea-type fields', function(){
|
||||
it('delete fields created texts', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get(':nth-child(3) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
cy.get(':nth-child(4) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
cy.get(':nth-child(5) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
cy.get(':nth-child(6) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
cy.get(':nth-child(7) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||||
})
|
||||
})
|
||||
|
||||
context('create date-type fields', function(){
|
||||
it('canceled create date field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'date name canceled')
|
||||
})
|
||||
|
||||
it('create date field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public')
|
||||
})
|
||||
|
||||
it('create date field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name private')
|
||||
})
|
||||
|
||||
it('create date field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public required')
|
||||
})
|
||||
|
||||
it('create date field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public multiple values')
|
||||
})
|
||||
|
||||
it('create date field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'Text name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public unique values')
|
||||
})
|
||||
})
|
||||
|
||||
context('create numeric-type fields', function(){
|
||||
it('canceled create date field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'numeric name canceled')
|
||||
})
|
||||
|
||||
it('create numeric field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public')
|
||||
})
|
||||
|
||||
it('create numeric field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name private')
|
||||
})
|
||||
|
||||
it('create numeric field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public required')
|
||||
})
|
||||
|
||||
it('create numeric field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public multiple values')
|
||||
})
|
||||
|
||||
it('create numeric field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'Text name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public unique values')
|
||||
})
|
||||
})
|
||||
|
||||
context('create select-type fields', function(){
|
||||
it('canceled create select field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'select name canceled')
|
||||
})
|
||||
|
||||
it('create select field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public')
|
||||
})
|
||||
|
||||
it('create select field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name private')
|
||||
})
|
||||
|
||||
it('create select field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public required')
|
||||
})
|
||||
|
||||
it('create select field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public multiple values')
|
||||
})
|
||||
|
||||
it('create select field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'Text name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public unique values')
|
||||
})
|
||||
})
|
||||
|
||||
context('create relationship-type fields', function(){
|
||||
it('create collection for create relationship', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.contains('New Collection').click()
|
||||
cy.get('#tainacan-text-name').type('Book relationship')
|
||||
cy.get('#tainacan-text-description').type('Descrição book relationship')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-collection-creation').click()
|
||||
cy.get('#primary-menu > .menu > .menu-header > .menu-list > li > .router-link-active > .icon > .mdi').click()
|
||||
cy.get('.b-table').should('contain', 'Book relationship')
|
||||
})
|
||||
|
||||
it('canceled create select field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'relationship name canceled')
|
||||
})
|
||||
|
||||
it('create relationship field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public')
|
||||
})
|
||||
|
||||
it('create relationship field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name private')
|
||||
})
|
||||
|
||||
it('create relationship field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public required')
|
||||
})
|
||||
|
||||
it('create relationship field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public multiple values')
|
||||
})
|
||||
|
||||
it('create relationship field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'Text name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public unique values')
|
||||
})
|
||||
})
|
||||
})
|
|
@ -1,23 +0,0 @@
|
|||
describe('Configuration Plugin Test', function () {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.loginByUI()
|
||||
})
|
||||
|
||||
context ('Configuration', function(){
|
||||
it('plugins active', function () {
|
||||
cy.visit('wp-admin/plugins.php')
|
||||
cy.get('.subsubsub > .active > a').click()
|
||||
cy.get('.wp-list-table').should('contain', 'Tainacan').and('contain', 'WP Cypress DB Cleaner')
|
||||
})
|
||||
|
||||
it('WPress configuration', function(){
|
||||
cy.contains('WPress').click()
|
||||
cy.get('#default-api-namespace').clear()
|
||||
cy.get('#default-api-namespace').type('tainacan/v2')
|
||||
cy.get('#default-db-prefix').clear()
|
||||
cy.get('#default-db-prefix').type('wptests_')
|
||||
cy.get('#submit').click()
|
||||
})
|
||||
})
|
||||
})
|
|
@ -0,0 +1,201 @@
|
|||
context('create category-type fields tests', function(){
|
||||
beforeEach(() => {
|
||||
cy.loginByUI()
|
||||
})
|
||||
|
||||
it('clear DB', function(){
|
||||
cy.clearDB()
|
||||
})
|
||||
|
||||
it('create collection for create fields', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.contains('New Collection').click()
|
||||
cy.get('#tainacan-text-name').type('Book Fields')
|
||||
cy.get('#tainacan-text-description').type('Descrição book Fields')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-collection-creation').click()
|
||||
cy.get('#primary-menu > .menu > .menu-header > .menu-list > li > .router-link-active > .icon > .mdi').click()
|
||||
cy.get('.b-table').should('contain', 'Book Fields')
|
||||
})
|
||||
|
||||
it('create taxonomies for create relationship', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(8) > a > .menu-text').click()
|
||||
cy.get('.button').click()
|
||||
cy.get('#tainacan-text-name').type('Cat 1')
|
||||
cy.get('#tainacan-text-description').type('description cat 1')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-category-creation').click()
|
||||
cy.get('.page-container').should('contain', 'Cat 1')
|
||||
cy.get('.button').click()
|
||||
cy.get('#tainacan-text-name').type('Cat 2')
|
||||
cy.get('#tainacan-text-description').type('description cat 2')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-category-creation').click()
|
||||
cy.get('.page-container').should('contain', 'Cat 2')
|
||||
cy.get('.button').click()
|
||||
cy.get('#tainacan-text-name').type('Cat 3')
|
||||
cy.get('#tainacan-text-description').type('description cat 3')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-category-creation').click()
|
||||
cy.get('.page-container').should('contain', 'Cat 3')
|
||||
cy.get('.button').click()
|
||||
cy.get('#tainacan-text-name').type('Cat 4')
|
||||
cy.get('#tainacan-text-description').type('description cat 4')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-category-creation').click()
|
||||
cy.get('.page-container').should('contain', 'Cat 4')
|
||||
cy.get('.button').click()
|
||||
cy.get('#tainacan-text-name').type('Cat 5')
|
||||
cy.get('#tainacan-text-description').type('description cat 5')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-category-creation').click()
|
||||
cy.get('.page-container').should('contain', 'Cat 5')
|
||||
cy.get('#tainacan-text-name').type('Cat 6')
|
||||
cy.get('#tainacan-text-description').type('description cat 6')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-category-creation').click()
|
||||
cy.get('.page-container').should('contain', 'Cat 6')
|
||||
})
|
||||
|
||||
it('canceled create category-type field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(7)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('category name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'category name canceled')
|
||||
})
|
||||
|
||||
it('create category-type field public - input type = radio', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(7)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('category name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .control > .select > select').select('Cat 1')
|
||||
cy.get(':nth-child(2) > .control > .select > select').select('Radio').should('have.value', 'tainacan-category-radio')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'category name public')
|
||||
})
|
||||
|
||||
it('create category-type field public - input type = selectbox', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(7)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('category name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .control > .select > select').select('Cat 1')
|
||||
cy.get(':nth-child(2) > .control > .select > select').select('Selectbox').should('have.value', 'tainacan-category-selectbox')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'category name public')
|
||||
})
|
||||
|
||||
it('create category-type field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(7)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('category name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get(':nth-child(1) > .control > .select > select').select('Cat 2')
|
||||
cy.get(':nth-child(2) > .control > .select > select').select('Radio').should('have.value', 'tainacan-category-radio')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'category name private')
|
||||
})
|
||||
|
||||
it('create category-type field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(7)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('category name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .control > .select > select').select('Cat 3')
|
||||
cy.get(':nth-child(2) > .control > .select > select').select('Radio').should('have.value', 'tainacan-category-radio')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'category name public required')
|
||||
})
|
||||
|
||||
it('create category-type field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(7)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('category name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .control > .select > select').select('Cat 4')
|
||||
cy.get(':nth-child(2) > .control > .select > select').select('Radio').should('have.value', 'tainacan-category-radio')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'category name public multiple values')
|
||||
})
|
||||
|
||||
it('create category-type field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(7)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('category name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .control > .select > select').select('Cat 5')
|
||||
cy.get(':nth-child(2) > .control > .select > select').select('Radio').should('have.value', 'tainacan-category-radio')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'category name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(7) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'category name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'category name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'category name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'category name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'category name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'category name public unique values')
|
||||
})
|
||||
})
|
|
@ -0,0 +1,135 @@
|
|||
context('create date-type fields tests', function(){
|
||||
beforeEach(() => {
|
||||
cy.loginByUI()
|
||||
})
|
||||
|
||||
it('clear DB', function(){
|
||||
cy.clearDB()
|
||||
})
|
||||
|
||||
it('create collection for create fields', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.contains('New Collection').click()
|
||||
cy.get('#tainacan-text-name').type('Book Fields')
|
||||
cy.get('#tainacan-text-description').type('Descrição book Fields')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-collection-creation').click()
|
||||
cy.get('#primary-menu > .menu > .menu-header > .menu-list > li > .router-link-active > .icon > .mdi').click()
|
||||
cy.get('.b-table').should('contain', 'Book Fields')
|
||||
})
|
||||
|
||||
it('canceled create date field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'date name canceled')
|
||||
})
|
||||
|
||||
it('create date-type field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public')
|
||||
})
|
||||
|
||||
it('create date-type field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name private')
|
||||
})
|
||||
|
||||
it('create date-type field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public required')
|
||||
})
|
||||
|
||||
it('create date-type field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public multiple values')
|
||||
})
|
||||
|
||||
it('create date-type field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('date name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'date name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'date name public unique values')
|
||||
})
|
||||
})
|
|
@ -0,0 +1,135 @@
|
|||
context('create numeric-type fields tests', function(){
|
||||
beforeEach(() => {
|
||||
cy.loginByUI()
|
||||
})
|
||||
|
||||
it('clear DB', function(){
|
||||
cy.clearDB()
|
||||
})
|
||||
|
||||
it('create collection for create fields', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.contains('New Collection').click()
|
||||
cy.get('#tainacan-text-name').type('Book Fields')
|
||||
cy.get('#tainacan-text-description').type('Descrição book Fields')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-collection-creation').click()
|
||||
cy.get('#primary-menu > .menu > .menu-header > .menu-list > li > .router-link-active > .icon > .mdi').click()
|
||||
cy.get('.b-table').should('contain', 'Book Fields')
|
||||
})
|
||||
|
||||
it('canceled create date field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'numeric name canceled')
|
||||
})
|
||||
|
||||
it('create numeric-type field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public')
|
||||
})
|
||||
|
||||
it('create numeric-type field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name private')
|
||||
})
|
||||
|
||||
it('create numeric-type field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public required')
|
||||
})
|
||||
|
||||
it('create numeric-type field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public multiple values')
|
||||
})
|
||||
|
||||
it('create numeric-type field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('numeric name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'numeric name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'numeric name public unique values')
|
||||
})
|
||||
})
|
|
@ -0,0 +1,162 @@
|
|||
context('create relationship-type fields tests', function(){
|
||||
beforeEach(() => {
|
||||
cy.loginByUI()
|
||||
})
|
||||
|
||||
it('clear DB', function(){
|
||||
cy.clearDB()
|
||||
})
|
||||
|
||||
it('create collection for create fields', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.contains('New Collection').click()
|
||||
cy.get('#tainacan-text-name').type('Book Fields')
|
||||
cy.get('#tainacan-text-description').type('Descrição book Fields')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-collection-creation').click()
|
||||
cy.get('#primary-menu > .menu > .menu-header > .menu-list > li > .router-link-active > .icon > .mdi').click()
|
||||
cy.get('.b-table').should('contain', 'Book Fields')
|
||||
})
|
||||
|
||||
it('create collection for create relationship', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.contains('New Collection').click()
|
||||
cy.get('#tainacan-text-name').type('Book relationship')
|
||||
cy.get('#tainacan-text-description').type('Descrição book relationship')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-collection-creation').click()
|
||||
cy.get('#primary-menu > .menu > .menu-header > .menu-list > li > .router-link-active > .icon > .mdi').click()
|
||||
cy.get('.b-table').should('contain', 'Book relationship')
|
||||
})
|
||||
|
||||
it('canceled create relationship-type field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'relationship name canceled')
|
||||
})
|
||||
|
||||
it('create relationship-type field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public')
|
||||
})
|
||||
|
||||
it('create relationship-type field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name private')
|
||||
})
|
||||
|
||||
it('create relationship-type field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public required')
|
||||
})
|
||||
|
||||
it('create relationship-type field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public multiple values')
|
||||
})
|
||||
|
||||
it('create relationship-type field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(6)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('relationship name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get('select').select('Book relationship')
|
||||
cy.get(':nth-child(1) > .b-checkbox > .check').click()
|
||||
cy.get('.block > :nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'relationship name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'relationship name public unique values')
|
||||
})
|
||||
})
|
|
@ -0,0 +1,150 @@
|
|||
context('create select-type fields tests', function(){
|
||||
beforeEach(() => {
|
||||
cy.loginByUI()
|
||||
})
|
||||
|
||||
it('clear DB', function(){
|
||||
cy.clearDB()
|
||||
})
|
||||
|
||||
it('create collection for create fields', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.contains('New Collection').click()
|
||||
cy.get('#tainacan-text-name').type('Book Fields')
|
||||
cy.get('#tainacan-text-description').type('Descrição book Fields')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-collection-creation').click()
|
||||
cy.get('#primary-menu > .menu > .menu-header > .menu-list > li > .router-link-active > .icon > .mdi').click()
|
||||
cy.get('.b-table').should('contain', 'Book Fields')
|
||||
})
|
||||
|
||||
it('canceled create select field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'select name canceled')
|
||||
})
|
||||
|
||||
it('create select-type field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public')
|
||||
})
|
||||
|
||||
it('create select-type field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name private')
|
||||
})
|
||||
|
||||
it('create select-type field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public required')
|
||||
})
|
||||
|
||||
it('create select-type field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public multiple values')
|
||||
})
|
||||
|
||||
it('create select-type field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(5)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('select name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get('.autocomplete > .control > .input').type('select1{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select2{enter}')
|
||||
cy.get('.autocomplete > .control > .input').type('select3{enter}')
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'select name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'select name public unique values')
|
||||
})
|
||||
})
|
|
@ -0,0 +1,135 @@
|
|||
context('create textArea-type fields tests', function(){
|
||||
beforeEach(() => {
|
||||
cy.loginByUI()
|
||||
})
|
||||
|
||||
it('clear DB', function(){
|
||||
cy.clearDB()
|
||||
})
|
||||
|
||||
it('create collection for create fields', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.contains('New Collection').click()
|
||||
cy.get('#tainacan-text-name').type('Book Fields')
|
||||
cy.get('#tainacan-text-description').type('Descrição book Fields')
|
||||
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
|
||||
cy.get('#button-submit-collection-creation').click()
|
||||
cy.get('#primary-menu > .menu > .menu-header > .menu-list > li > .router-link-active > .icon > .mdi').click()
|
||||
cy.get('.b-table').should('contain', 'Book Fields')
|
||||
})
|
||||
|
||||
it('canceled create textArea field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name canceled')
|
||||
cy.get('.textarea').type('name book canceled description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(1) > .button').click()
|
||||
cy.get('.active-fields-area >').should('not.contain', 'TextArea name canceled')
|
||||
})
|
||||
|
||||
it('create textArea-type field public', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name public')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public')
|
||||
})
|
||||
|
||||
it('create textArea-type field private', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name private')
|
||||
cy.get('.textarea').type('name book description')
|
||||
cy.get('#tainacan-select-status-private > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name private')
|
||||
})
|
||||
|
||||
it('create textArea-type field public required', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name public required')
|
||||
cy.get('.textarea').type('name book description required')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(2) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public required')
|
||||
})
|
||||
|
||||
it('create textArea-type field public multiple values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name public multiple values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(3) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public multiple values')
|
||||
})
|
||||
|
||||
it('create textArea-type field public unique values', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.field > :nth-child(2) > :nth-child(2)').click()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').clear()
|
||||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('TextArea name public unique values')
|
||||
cy.get('.textarea').type('name book description multiple values')
|
||||
cy.get('#tainacan-select-status-publish > .check').click()
|
||||
cy.get(':nth-child(4) > .b-checkbox > .check').click()
|
||||
cy.get(':nth-child(2) > .button').click()
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public unique values')
|
||||
})
|
||||
|
||||
it('check if fields are updated to page', function(){
|
||||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||||
cy.get('h1').should('contain', 'Collections Page')
|
||||
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
|
||||
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
|
||||
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
|
||||
cy.get('h1').should('contain', 'Collection Fields Edition Page')
|
||||
cy.get('.active-fields-area >').should('not.contain', 'TextArea name canceled')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name private')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public required')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public multiple values')
|
||||
cy.get('.active-fields-area >').should('contain', 'TextArea name public unique values')
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue