From 4b74bec2f6a150c8efa25119b139a410a2c437e8 Mon Sep 17 00:00:00 2001 From: juliannyas Date: Thu, 22 Mar 2018 18:02:45 -0300 Subject: [PATCH] creates tests for the creation of fields --- cypress.json | 4 +- .../fields/collection_fields_text_spec.js | 791 ++++++++++++++++++ .../items/collection_items_spec.js} | 0 .../tainacan_collection_fields_spec.js | 123 --- 4 files changed, 793 insertions(+), 125 deletions(-) create mode 100644 cypress/integration/collection/fields/collection_fields_text_spec.js rename cypress/integration/{tainacan_collection_spec.js => collection/items/collection_items_spec.js} (100%) delete mode 100644 cypress/integration/tainacan_collection_fields_spec.js diff --git a/cypress.json b/cypress.json index 4c18055d3..eedb52264 100644 --- a/cypress.json +++ b/cypress.json @@ -1,6 +1,6 @@ { "projectId": "tubzok", "videoRecording": false, - "viewportWidth": 1920, - "viewportHeight": 1080 + "viewportWidth": 1280, + "viewportHeight": 720 } diff --git a/cypress/integration/collection/fields/collection_fields_text_spec.js b/cypress/integration/collection/fields/collection_fields_text_spec.js new file mode 100644 index 000000000..0bc070af3 --- /dev/null +++ b/cypress/integration/collection/fields/collection_fields_text_spec.js @@ -0,0 +1,791 @@ +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') + }) + }) +}) diff --git a/cypress/integration/tainacan_collection_spec.js b/cypress/integration/collection/items/collection_items_spec.js similarity index 100% rename from cypress/integration/tainacan_collection_spec.js rename to cypress/integration/collection/items/collection_items_spec.js diff --git a/cypress/integration/tainacan_collection_fields_spec.js b/cypress/integration/tainacan_collection_fields_spec.js deleted file mode 100644 index 0cce3743f..000000000 --- a/cypress/integration/tainacan_collection_fields_spec.js +++ /dev/null @@ -1,123 +0,0 @@ -describe('Tainacan Plugin Test', function () { - beforeEach(() => { - cy.loginByUI() - }) - - context('text-type fields', function(){ - it('clear DB', function(){ - cy.clearDB() - }) - - it('create collection for 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 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('Book 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', 'Book name canceled') - cy.get('.active-fields-area >').should('not.contain', 'Text') - }) - - 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('Book 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', 'Book 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('Book 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', 'Book 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('Book 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', 'Book 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('Book 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', 'Book 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('Book 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', 'Book name public unique values') - }) - }) -})