461 lines
26 KiB
JavaScript
461 lines
26 KiB
JavaScript
describe('Date field 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.location('hash').should('eq', '#/collections')
|
||
cy.get('#button-create-collection').click()
|
||
cy.get('#tainacan-text-name').type('Date Fields')
|
||
cy.get('#tainacan-text-description').type('Description Date 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', 'Date Fields')
|
||
})
|
||
|
||
context('CRUD date field', function(){
|
||
it('create submission date field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Submission date')
|
||
cy.get('.textarea').type('description submission date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.handle > .field-name').should('contain', 'Submission date')
|
||
})
|
||
|
||
it('check create submission date field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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.contains('Submission date')
|
||
})
|
||
|
||
it('create year of manufacture field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Year of manufacture')
|
||
cy.get('.textarea').type('description year of manufacture')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.handle > .field-name').should('contain', 'Year of manufacture')
|
||
})
|
||
|
||
it('check create year of manufacture field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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.contains('Year of manufacture')
|
||
})
|
||
|
||
it('edit year of manufacture field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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(4) > .handle > .controls > :nth-child(2) > .icon > .mdi').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type(' edited')
|
||
cy.get('.textarea').type(' edited')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.handle > .field-name').should('contain', 'Year of manufacture edited')
|
||
})
|
||
|
||
it('create year field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Year')
|
||
cy.get('.textarea').type('description year')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.handle > .field-name').should('contain', 'Year')
|
||
})
|
||
|
||
it('delete year field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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.contains('Year')
|
||
cy.get(':nth-child(5) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
|
||
cy.get('.handle > .field-name').should('not.eq', 'Year')
|
||
})
|
||
|
||
it('check not contain year field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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('.handle > .field-name').should('not.eq', 'Year')
|
||
})
|
||
})
|
||
|
||
context('Diseble date field', function(){
|
||
it('create purchase day field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Purchase day disebled')
|
||
cy.get('.textarea').type('description purchase day')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.active-fields-area >').should('contain', 'Purchase day disebled')
|
||
})
|
||
|
||
it('disebled purchase day field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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(5) > .handle > .controls > .switch > .check').click()
|
||
cy.get('.active-fields-area > :nth-child(5)').should('have.class', 'disabled-field')
|
||
})
|
||
|
||
it('check disebled purchase day field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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 > :nth-child(5)').should('have.class', 'disabled-field')
|
||
})
|
||
})
|
||
|
||
context('Check required fields', function(){
|
||
it('create blank field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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('.not-focusable-item > .handle > .label-details').should('contain', 'Not saved')
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Bank{selectall}{del}')
|
||
cy.get('.textarea').clear()
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.not-focusable-item > .handle > .field-name').should('have.class', 'is-danger')
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').should('have.class', 'is-danger')
|
||
cy.get(':nth-child(1) > .button').click()
|
||
cy.get('.active-fields-area > :nth-child(6) > .handle > .field-name').should('not.contain', 'Blank').and('contain', 'Date')
|
||
cy.get('.active-fields-area > :nth-child(6) > .handle > .label-details').should('contain', 'Not saved')
|
||
})
|
||
|
||
it('check not contain blank field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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', 'Blank')
|
||
})
|
||
})
|
||
|
||
context('Create date field private', function(){
|
||
it('create date private field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Date private')
|
||
cy.get('.textarea').type('description private')
|
||
cy.get('#tainacan-select-status-private > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.active-fields-area >').should('contain', 'Date private')
|
||
})
|
||
|
||
it('check create date private field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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 > :nth-child(6) > .handle > .field-name').should('contain', 'Date private')
|
||
cy.get(':nth-child(6) > .handle > .controls > :nth-child(2) > .icon > .mdi').click()
|
||
cy.get('#tainacan-select-status-private > .check').should('be.selected')
|
||
})
|
||
})
|
||
|
||
context('"Not saved" label vs. "cancel button"', function(){
|
||
it('create warranty field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Warranty')
|
||
cy.get('.textarea').type('description warranty')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.active-fields-area >').should('contain', 'Warranty')
|
||
})
|
||
|
||
it('check that ‘Not Saved’ label wasn’t inserted, and changes were lost', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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 > :nth-child(7) > .handle > .field-name').should('contain', 'Warranty')
|
||
cy.get(':nth-child(7) > .handle > .controls > :nth-child(2) > .icon > .mdi').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type(' edited')
|
||
cy.get('.textarea').type(' edited')
|
||
cy.get('#tainacan-select-status-private > .check').click()
|
||
cy.get(':nth-child(1) > .button').click()
|
||
cy.get('.active-fields-area >').should('not.contain', 'Warranty edited')
|
||
cy.get('.active-fields-area > :nth-child(7) > .handle > .label-details').should('not.contain', 'Not saved')
|
||
})
|
||
|
||
it('check if the message “Not Saved” appeared next to the field name', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Date Type')
|
||
cy.get('.textarea').type('description new')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(1) > .button').click()
|
||
cy.get('.active-fields-area > :nth-child(8) > .handle > .field-name').should('not.eq', 'Date Type').and('contain', 'Date')
|
||
cy.get('.active-fields-area > :nth-child(8) > .handle > .label-details').should('contain', 'Not saved')
|
||
cy.get(':nth-child(8) > .handle > .controls > :nth-child(2) > .icon > .mdi').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date Type')
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.active-fields-area > :nth-child(8) > .handle > .field-name').should('contain', 'Date Type').and('not.eq', 'Date')
|
||
cy.get('.active-fields-area > :nth-child(8) > .handle > .label-details').should('not.eq', 'Not saved')
|
||
})
|
||
})
|
||
|
||
context('Fields Sorting', function(){
|
||
})
|
||
|
||
context('create date-types fields tests', function(){
|
||
it('canceled create date field', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Date name canceled')
|
||
cy.get('.textarea').type('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 required', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Date name public required')
|
||
cy.get('.textarea').type('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.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Date name public multiple values')
|
||
cy.get('.textarea').type('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.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}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')
|
||
})
|
||
})
|
||
|
||
context('Leave page without saving field editions', function(){
|
||
it('Leave page without saving field editions', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Not Saved')
|
||
cy.get('.textarea').type('description')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.contains('Items').click()
|
||
cy.get('.modal-card').should('have.class', 'animation-content')
|
||
cy.get('.modal-card-foot > :nth-child(1)').click()
|
||
cy.get(':nth-child(1) > .button').click()
|
||
cy.get('.active-fields-area >').should('not.contain', 'Not Saved').and('contain', 'Date')
|
||
cy.get('.menu > :nth-child(2) > :nth-child(8) > a').click()
|
||
cy.get('.modal-card').should('have.class', 'is-titleless')
|
||
})
|
||
})
|
||
|
||
context('Field loading for paging and persistence testing', function(){
|
||
it('create dates fields', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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').type('{selectall}{del}Date 1')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date 2')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date 3')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date 4')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date 5')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date 6')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date 7')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date 8')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date 9')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
cy.get('.field > :nth-child(2) > :nth-child(3)').click()
|
||
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Date 10')
|
||
cy.get('.textarea').type('description date')
|
||
cy.get('#tainacan-select-status-publish > .check').click()
|
||
cy.get(':nth-child(2) > .button').click()
|
||
})
|
||
|
||
it('check if fields are updated to page', function(){
|
||
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
|
||
cy.location('hash').should('eq', '#/collections')
|
||
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('contain', 'Submission date')
|
||
.and('contain', 'Year of manufacture edited')
|
||
.and('contain', 'Purchase day disebled')
|
||
.and('contain', 'Date Private')
|
||
.and('not.contain', 'Blank')
|
||
.and('contain', 'Warranty')
|
||
.and('contain', 'Date Type')
|
||
.and('not.contain', 'Date name canceled')
|
||
.and('contain', 'Date name public required')
|
||
.and('contain', 'Date name public multiple values')
|
||
.and('contain', 'Date name public unique values')
|
||
.and('contain', 'Date 1')
|
||
.and('contain', 'Date 2')
|
||
.and('contain', 'Date 3')
|
||
.and('contain', 'Date 4')
|
||
.and('contain', 'Date 5')
|
||
.and('contain', 'Date 6')
|
||
.and('contain', 'Date 7')
|
||
.and('contain', 'Date 8')
|
||
.and('contain', 'Date 9')
|
||
.and('contain', 'Date 10')
|
||
})
|
||
})
|
||
})
|