From 41d30209fba1a1c192c50cc20df480935576a293 Mon Sep 17 00:00:00 2001 From: juliannyas Date: Thu, 12 Apr 2018 18:21:32 -0300 Subject: [PATCH] refactor selectors of the buttons for creating collections and items --- .../integration/repository/category_spec.js | 162 +++++++++--------- .../repository/collection/collection_spec.js | 42 ++--- .../collection/field/field_category_spec.js | 2 +- .../collection/field/field_date_spec.js | 2 +- .../collection/field/field_numeric_spec.js | 2 +- .../field/field_relationship_spec.js | 2 +- .../collection/field/field_selectbox_spec.js | 2 +- .../collection/field/field_textArea_spec.js | 2 +- .../collection/field/field_text_spec.js | 2 +- .../repository/collection/item_spec.js | 44 ++--- run-cypress.sh | 4 +- 11 files changed, 133 insertions(+), 133 deletions(-) diff --git a/cypress/integration/repository/category_spec.js b/cypress/integration/repository/category_spec.js index e1383b72b..79a5835bc 100644 --- a/cypress/integration/repository/category_spec.js +++ b/cypress/integration/repository/category_spec.js @@ -22,86 +22,86 @@ describe('Category test', function () { cy.get('td').should('not.contain', 'Book canceled') }) - // it('create category with status publish', function(){ - // cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') - // cy.location('hash').should('eq', '#/categories') - // //cy.get('#button-category-creation').click() - // cy.get('.button').click() - // cy.location('hash').should('eq', '#/categories/new') - // cy.get('#tainacan-text-name').type('Category publish') - // cy.get('#tainacan-text-description').type('description category publish') - // cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish') - // cy.get('#button-submit-category-creation').click() - // cy.location('hash').should('eq', '#/categories/') - // cy.get('td').should('contain', 'Category publish') - // }) - // - // it('create category with status private', function(){ - // cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') - // cy.location('hash').should('eq', '#/categories') - // //cy.get('#button-category-creation').click() - // cy.get('.button').click() - // cy.location('hash').should('eq', '#/categories/new') - // cy.get('#tainacan-text-name').type('Category private') - // cy.get('#tainacan-text-description').type('description category private') - // cy.get('#tainacan-select-status').select('Private').should('have.value', 'private') - // cy.get('#button-submit-category-creation').click() - // cy.location('hash').should('eq', '#/categories/') - // cy.get('td').should('contain', 'Category private') - // }) - // - // it('create category with status draft', function(){ - // cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') - // cy.location('hash').should('eq', '#/categories') - // //cy.get('#button-category-creation').click() - // cy.get('.button').click() - // cy.location('hash').should('eq', '#/categories/new') - // cy.get('#tainacan-text-name').type('Category draft') - // cy.get('#tainacan-text-description').type('description category draft') - // cy.get('#tainacan-select-status').select('Draft').should('have.value', 'draft') - // cy.get('#button-submit-category-creation').click() - // cy.location('hash').should('eq', '#/categories/') - // cy.get('td').should('not.contain', 'Category draft') - // }) - // - // it('create category with status draft', function(){ - // cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') - // cy.location('hash').should('eq', '#/categories') - // //cy.get('#button-category-creation').click() - // cy.get('.button').click() - // cy.location('hash').should('eq', '#/categories/new') - // cy.get('#tainacan-text-name').type('Category trash') - // cy.get('#tainacan-text-description').type('description category trash') - // cy.get('#tainacan-select-status').select('Trash').should('have.value', 'trash') - // cy.get('#button-submit-category-creation').click() - // cy.location('hash').should('eq', '#/categories/') - // cy.get('td').should('not.contain', 'Category trash') - // }) - // - // it('create category color', function(){ - // cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') - // cy.location('hash').should('eq', '#/categories') - // //cy.get('#button-category-creation').click() - // cy.get('.button').click() - // cy.location('hash').should('eq', '#/categories/new') - // cy.get('#tainacan-text-name').type('Category color') - // cy.get('#tainacan-text-description').type('description category color') - // cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish') - // cy.get('#button-submit-category-creation').click() - // cy.location('hash').should('eq', '#/categories/') - // cy.get('td').should('contain', 'Category color') - // }) - // - // it('delete category color', function(){ - // cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') - // cy.location('hash').should('eq', '#/categories') - // cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() - // cy.get('.b-table').should('contain', 'Category trash') - // cy.get(':nth-child(1) > [data-label="Actions"] > :nth-child(1) > #button-delete > .icon > .mdi').click() - // cy.get('.modal-card').should('have.class', 'animation-content') - // cy.get('.is-primary').click() - // cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() - // cy.get('.b-table').should('not.contain', 'Category trash') - // }) + it('create category with status publish', function(){ + cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') + cy.location('hash').should('eq', '#/categories') + //cy.get('#button-category-creation').click() + cy.get('.button').click() + cy.location('hash').should('eq', '#/categories/new') + cy.get('#tainacan-text-name').type('Category publish') + cy.get('#tainacan-text-description').type('description category publish') + cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish') + cy.get('#button-submit-category-creation').click() + cy.location('hash').should('eq', '#/categories/') + cy.get('td').should('contain', 'Category publish') + }) + + it('create category with status private', function(){ + cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') + cy.location('hash').should('eq', '#/categories') + //cy.get('#button-category-creation').click() + cy.get('.button').click() + cy.location('hash').should('eq', '#/categories/new') + cy.get('#tainacan-text-name').type('Category private') + cy.get('#tainacan-text-description').type('description category private') + cy.get('#tainacan-select-status').select('Private').should('have.value', 'private') + cy.get('#button-submit-category-creation').click() + cy.location('hash').should('eq', '#/categories/') + cy.get('td').should('contain', 'Category private') + }) + + it('create category with status draft', function(){ + cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') + cy.location('hash').should('eq', '#/categories') + //cy.get('#button-category-creation').click() + cy.get('.button').click() + cy.location('hash').should('eq', '#/categories/new') + cy.get('#tainacan-text-name').type('Category draft') + cy.get('#tainacan-text-description').type('description category draft') + cy.get('#tainacan-select-status').select('Draft').should('have.value', 'draft') + cy.get('#button-submit-category-creation').click() + cy.location('hash').should('eq', '#/categories/') + cy.get('td').should('not.contain', 'Category draft') + }) + + it('create category with status draft', function(){ + cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') + cy.location('hash').should('eq', '#/categories') + //cy.get('#button-category-creation').click() + cy.get('.button').click() + cy.location('hash').should('eq', '#/categories/new') + cy.get('#tainacan-text-name').type('Category trash') + cy.get('#tainacan-text-description').type('description category trash') + cy.get('#tainacan-select-status').select('Trash').should('have.value', 'trash') + cy.get('#button-submit-category-creation').click() + cy.location('hash').should('eq', '#/categories/') + cy.get('td').should('not.contain', 'Category trash') + }) + + it('create category color', function(){ + cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') + cy.location('hash').should('eq', '#/categories') + //cy.get('#button-category-creation').click() + cy.get('.button').click() + cy.location('hash').should('eq', '#/categories/new') + cy.get('#tainacan-text-name').type('Category color') + cy.get('#tainacan-text-description').type('description category color') + cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish') + cy.get('#button-submit-category-creation').click() + cy.location('hash').should('eq', '#/categories/') + cy.get('td').should('contain', 'Category color') + }) + + it('delete category color', function(){ + cy.visit('/wp-admin/admin.php?page=tainacan_admin#/categories') + cy.location('hash').should('eq', '#/categories') + cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() + cy.get('.b-table').should('contain', 'Category trash') + cy.get(':nth-child(1) > [data-label="Actions"] > :nth-child(1) > #button-delete > .icon > .mdi').click() + cy.get('.modal-card').should('have.class', 'animation-content') + cy.get('.is-primary').click() + cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() + cy.get('.b-table').should('not.contain', 'Category trash') + }) }) }) diff --git a/cypress/integration/repository/collection/collection_spec.js b/cypress/integration/repository/collection/collection_spec.js index 17d3ce7db..77d0eba1b 100644 --- a/cypress/integration/repository/collection/collection_spec.js +++ b/cypress/integration/repository/collection/collection_spec.js @@ -11,7 +11,7 @@ describe('Collection test', function () { it('canceled collection', function(){ cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.location('hash').should('eq', '#/collections') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book canceled') cy.get('#tainacan-text-description').type('description book canceled') @@ -23,7 +23,7 @@ describe('Collection test', function () { it('create collection with status publish', function(){ cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.location('hash').should('eq', '#/collections') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book publish') cy.get('#tainacan-text-description').type('description book publish') @@ -37,7 +37,7 @@ describe('Collection test', function () { it('create collection with status private', function(){ cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.location('hash').should('eq', '#/collections') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book private') cy.get('#tainacan-text-description').type('description book private') @@ -51,7 +51,7 @@ describe('Collection test', function () { it('create collection with status draft', function(){ cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.location('hash').should('eq', '#/collections') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book draft') cy.get('#tainacan-text-description').type('description book draft') @@ -65,7 +65,7 @@ describe('Collection test', function () { it('create collection with status trash', function(){ cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.location('hash').should('eq', '#/collections') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book trash') cy.get('#tainacan-text-description').type('description book trash') @@ -79,7 +79,7 @@ describe('Collection test', function () { it('delete collection', function(){ cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.location('hash').should('eq', '#/collections') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book delete') cy.get('#tainacan-text-description').type('description book delete') @@ -100,7 +100,7 @@ describe('Collection test', function () { it('create many collections', function(){ cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.location('hash').should('eq', '#/collections') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 1') cy.get('#tainacan-text-description').type('description book 1') @@ -109,7 +109,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 1') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 2') cy.get('#tainacan-text-description').type('description book 2') @@ -118,7 +118,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 2') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 3') cy.get('#tainacan-text-description').type('description book 3') @@ -127,7 +127,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 3') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 4') cy.get('#tainacan-text-description').type('description book 4') @@ -136,7 +136,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 4') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 5') cy.get('#tainacan-text-description').type('description book 5') @@ -145,7 +145,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 5') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 6') cy.get('#tainacan-text-description').type('description book 6') @@ -154,7 +154,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 6') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 7') cy.get('#tainacan-text-description').type('description book 7') @@ -163,7 +163,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 7') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 8') cy.get('#tainacan-text-description').type('description book 8') @@ -172,7 +172,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 8') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 9') cy.get('#tainacan-text-description').type('description book 9') @@ -181,7 +181,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 9') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 10') cy.get('#tainacan-text-description').type('description book 10') @@ -190,7 +190,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 10') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 11') cy.get('#tainacan-text-description').type('description book 11') @@ -199,7 +199,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 11') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 12') cy.get('#tainacan-text-description').type('description book 12') @@ -208,7 +208,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 12') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 13') cy.get('#tainacan-text-description').type('description book 13') @@ -217,7 +217,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 13') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 14') cy.get('#tainacan-text-description').type('description book 14') @@ -226,7 +226,7 @@ describe('Collection test', function () { cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.location('hash').should('eq', '#/collections') cy.get('.b-table').should('contain', 'Book 14') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book 15') cy.get('#tainacan-text-description').type('description book 15') diff --git a/cypress/integration/repository/collection/field/field_category_spec.js b/cypress/integration/repository/collection/field/field_category_spec.js index ccdec71f3..acc54edeb 100644 --- a/cypress/integration/repository/collection/field/field_category_spec.js +++ b/cypress/integration/repository/collection/field/field_category_spec.js @@ -10,7 +10,7 @@ context('Category field test', function(){ 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-collection-creation').click() + cy.get('#button-create-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') diff --git a/cypress/integration/repository/collection/field/field_date_spec.js b/cypress/integration/repository/collection/field/field_date_spec.js index 53da10f47..0a09a323a 100644 --- a/cypress/integration/repository/collection/field/field_date_spec.js +++ b/cypress/integration/repository/collection/field/field_date_spec.js @@ -10,7 +10,7 @@ describe('Date field test', function() { 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-collection-creation').click() + 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') diff --git a/cypress/integration/repository/collection/field/field_numeric_spec.js b/cypress/integration/repository/collection/field/field_numeric_spec.js index bc465957b..3db8fde8e 100644 --- a/cypress/integration/repository/collection/field/field_numeric_spec.js +++ b/cypress/integration/repository/collection/field/field_numeric_spec.js @@ -10,7 +10,7 @@ describe('Numeric field test', function() { 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-collection-creation').click() + 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') diff --git a/cypress/integration/repository/collection/field/field_relationship_spec.js b/cypress/integration/repository/collection/field/field_relationship_spec.js index 51e671189..cd33c3986 100644 --- a/cypress/integration/repository/collection/field/field_relationship_spec.js +++ b/cypress/integration/repository/collection/field/field_relationship_spec.js @@ -10,7 +10,7 @@ context('Relationship field test', function(){ 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-collection-creation').click() + cy.get('#button-create-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') diff --git a/cypress/integration/repository/collection/field/field_selectbox_spec.js b/cypress/integration/repository/collection/field/field_selectbox_spec.js index f32492d04..fa188a795 100644 --- a/cypress/integration/repository/collection/field/field_selectbox_spec.js +++ b/cypress/integration/repository/collection/field/field_selectbox_spec.js @@ -10,7 +10,7 @@ describe('Selectbox field test', function() { 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-collection-creation').click() + cy.get('#button-create-collection').click() cy.get('#tainacan-text-name').type('Selectbox Fields') cy.get('#tainacan-text-description').type('Description Selectbox Fields') cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish') diff --git a/cypress/integration/repository/collection/field/field_textArea_spec.js b/cypress/integration/repository/collection/field/field_textArea_spec.js index 41827a163..9b465977c 100644 --- a/cypress/integration/repository/collection/field/field_textArea_spec.js +++ b/cypress/integration/repository/collection/field/field_textArea_spec.js @@ -10,7 +10,7 @@ describe('TextArea field test', function() { 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-collection-creation').click() + cy.get('#button-create-collection').click() cy.get('#tainacan-text-name').type('TextArea Fields') cy.get('#tainacan-text-description').type('Description TextArea Fields') cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish') diff --git a/cypress/integration/repository/collection/field/field_text_spec.js b/cypress/integration/repository/collection/field/field_text_spec.js index 0914e5032..8b6b24e55 100644 --- a/cypress/integration/repository/collection/field/field_text_spec.js +++ b/cypress/integration/repository/collection/field/field_text_spec.js @@ -10,7 +10,7 @@ describe('Text field test', function() { 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-collection-creation').click() + cy.get('#button-create-collection').click() cy.get('#tainacan-text-name').type('Book Text Fields') cy.get('#tainacan-text-description').type('Description book Fields') cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish') diff --git a/cypress/integration/repository/collection/item_spec.js b/cypress/integration/repository/collection/item_spec.js index 888a9e3c3..6f75aac83 100644 --- a/cypress/integration/repository/collection/item_spec.js +++ b/cypress/integration/repository/collection/item_spec.js @@ -10,7 +10,7 @@ describe('Item tests', function () { it('create collection for crud items', function(){ cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.location('hash').should('eq', '#/collections') - cy.get('#button-collection-creation').click() + cy.get('#button-create-collection').click() cy.location('hash').should('eq', '#/collections/new') cy.get('#tainacan-text-name').type('Book Items') cy.get('#tainacan-text-description').type('description book items') @@ -27,7 +27,7 @@ describe('Item tests', function () { 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('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item canceled') cy.get('#tainacan-textarea-description').type('Item canceled description') cy.get('#status-select').select('Publish').should('have.value', 'publish') @@ -41,7 +41,7 @@ describe('Item tests', function () { 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('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item publish') cy.get('#tainacan-textarea-description').type('Item publish description') cy.get('#status-select').select('Publish').should('have.value', 'publish') @@ -55,7 +55,7 @@ describe('Item tests', function () { 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('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item private') cy.get('#tainacan-textarea-description').type('Item private description') cy.get('#status-select').select('Private').should('have.value', 'private') @@ -69,7 +69,7 @@ describe('Item tests', function () { 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('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item draft') cy.get('#tainacan-textarea-description').type('Item draft description') cy.get('#status-select').select('Draft').should('have.value', 'draft') @@ -83,7 +83,7 @@ describe('Item tests', function () { 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('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item trash') cy.get('#tainacan-textarea-description').type('Item trash description') cy.get('#status-select').select('Trash').should('have.value', 'trash') @@ -97,7 +97,7 @@ describe('Item tests', function () { 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('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item delete') cy.get('#tainacan-textarea-description').type('Item delete description') cy.get('#status-select').select('Publish').should('have.value', 'publish') @@ -118,105 +118,105 @@ describe('Item tests', function () { 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('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 1') cy.get('#tainacan-textarea-description').type('Item 1 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 1') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 2') cy.get('#tainacan-textarea-description').type('Item 2 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 2') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 3') cy.get('#tainacan-textarea-description').type('Item 3 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 3') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 4') cy.get('#tainacan-textarea-description').type('Item 4 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 4') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 5') cy.get('#tainacan-textarea-description').type('Item 5 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 5') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 6') cy.get('#tainacan-textarea-description').type('Item 6 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 6') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 7') cy.get('#tainacan-textarea-description').type('Item 7 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 7') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 8') cy.get('#tainacan-textarea-description').type('Item 8 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 8') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 9') cy.get('#tainacan-textarea-description').type('Item 9 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 9') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 10') cy.get('#tainacan-textarea-description').type('Item 10 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 10') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 11') cy.get('#tainacan-textarea-description').type('Item 11 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 11') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 12') cy.get('#tainacan-textarea-description').type('Item 12 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 12') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 13') cy.get('#tainacan-textarea-description').type('Item 13 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 13') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 14') cy.get('#tainacan-textarea-description').type('Item 14 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') cy.get('#button-submit-item-creation').click() cy.get('.breadcrumbs > :nth-child(3) > .router-link-active').click() cy.get('.b-table').should('contain', 'Item 14') - cy.get('#button-item-creation').click() + cy.get('#button-create-item').click() cy.get('#tainacan-text-title').type('Item 15') cy.get('#tainacan-textarea-description').type('Item 15 description') cy.get('#status-select').select('Publish').should('have.value', 'publish') diff --git a/run-cypress.sh b/run-cypress.sh index c5f89e170..145d035e3 100755 --- a/run-cypress.sh +++ b/run-cypress.sh @@ -42,8 +42,8 @@ if [ "$OPTION" == "1" ]; then elif [ "$OPTION" == "2" ]; then ./node_modules/.bin/cypress run --config baseUrl=$wp_url --record --key $cy_record_key elif [ "$OPTION" == "3" ] && [ -n "$2" ]; then - UNIQUE_SPEC=cypress/integration/repository/${2} - ./node_modules/.bin/cypress run --spec $UNIQUE_SPEC --config baseUrl=$wp_url + UNIQUE_SPEC=cypress/integration/repository/${2} + ./node_modules/.bin/cypress run --spec $UNIQUE_SPEC --config baseUrl=$wp_url else echo -e "\nThe parameters provided are invalid\n" fi