tainacan/cypress/integration/repository/collection/field/field_numeric_spec.js

461 lines
26 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

describe('Numeric 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('Numeric Fields')
cy.get('#tainacan-text-description').type('Description Numeric 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', 'Numeric Fields')
})
context('CRUD numeric field', function(){
it('create counter 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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Counter')
cy.get('.textarea').type('description counter')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.handle > .field-name').should('contain', 'Counter')
})
it('check create counter 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('Counter')
})
it('create code 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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Code')
cy.get('.textarea').type('description code')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.handle > .field-name').should('contain', 'Code')
})
it('check create code 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('Code')
})
it('edit code 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', 'Code edited')
})
it('create number 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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Number')
cy.get('.textarea').type('description number')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.handle > .field-name').should('contain', 'Number')
})
it('delete number 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('Number')
cy.get(':nth-child(5) > .handle > .controls > :nth-child(3) > .icon > .mdi').click()
cy.get('.handle > .field-name').should('not.eq', 'Number')
})
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', 'Number')
})
})
context('Diseble numeric field', function(){
it('create registration number 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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Registration number disebled')
cy.get('.textarea').type('description registration number')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.active-fields-area >').should('contain', 'Registration number disebled')
})
it('disebled registration number 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 registration number 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(4)').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', 'Numeric')
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 numeric 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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 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', 'Numeric private')
})
it('check create numeric 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', 'Numeric 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 amount 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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Amount')
cy.get('.textarea').type('description amount')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.active-fields-area >').should('contain', 'Amount')
})
it('check that Not Saved label wasnt 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', 'Amount')
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', 'Amount 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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 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', 'Numeric Type').and('contain', 'Numeric')
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}Numeric Type')
cy.get(':nth-child(2) > .button').click()
cy.get('.active-fields-area > :nth-child(8) > .handle > .field-name').should('contain', 'Numeric Type').and('not.eq', 'Numeric')
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 numeric 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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 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', 'Numeric name canceled')
})
it('create numeric-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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 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', 'Numeric name public required')
})
it('create numeric-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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 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', '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.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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}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')
})
})
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(4)').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', 'Numeric')
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 numerics 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(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 1')
cy.get('.textarea').type('description numeric')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 2')
cy.get('.textarea').type('description numeric')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 3')
cy.get('.textarea').type('description numeric')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 4')
cy.get('.textarea').type('description numeric')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 5')
cy.get('.textarea').type('description numeric')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 6')
cy.get('.textarea').type('description numeric')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 7')
cy.get('.textarea').type('description numeric')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 8')
cy.get('.textarea').type('description numeric')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 9')
cy.get('.textarea').type('description numeric')
cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click()
cy.get('.field > :nth-child(2) > :nth-child(4)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Numeric 10')
cy.get('.textarea').type('description numeric')
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', 'Counter')
.and('contain', 'Code edited')
.and('contain', 'Registration number disabled')
.and('contain', 'Numeric Private')
.and('not.contain', 'Blank')
.and('contain', 'Amount')
.and('contain', 'Numeric Type')
.and('not.contain', 'Numeric name canceled')
.and('contain', 'Numeric name public required')
.and('contain', 'Numeric name public multiple values')
.and('contain', 'Numeric name public unique values')
.and('contain', 'Numeric 1')
.and('contain', 'Numeric 2')
.and('contain', 'Numeric 3')
.and('contain', 'Numeric 4')
.and('contain', 'Numeric 5')
.and('contain', 'Numeric 6')
.and('contain', 'Numeric 7')
.and('contain', 'Numeric 8')
.and('contain', 'Numeric 9')
.and('contain', 'Numeric 10')
})
})
})