Merge remote-tracking branch 'origin/develop' into exposers

This commit is contained in:
Jacson Passold 2018-04-12 16:47:53 -03:00
commit 427ac007be
46 changed files with 862 additions and 421 deletions

View File

@ -9,7 +9,7 @@ context('Category field test', function(){
it('create collection for create fields', function(){ it('create collection for create fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('#button-collection-creation').click() cy.get('#button-collection-creation').click()
cy.get('#tainacan-text-name').type('Book Fields') cy.get('#tainacan-text-name').type('Book Fields')
cy.get('#tainacan-text-description').type('Descrição book Fields') cy.get('#tainacan-text-description').type('Descrição book Fields')
@ -21,7 +21,7 @@ context('Category field test', function(){
it('create taxonomies for create relationship', function(){ it('create taxonomies for create relationship', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get(':nth-child(8) > a > .menu-text').click() cy.get(':nth-child(8) > a > .menu-text').click()
cy.get('.button').click() cy.get('.button').click()
cy.get('#tainacan-text-name').type('Cat 1') cy.get('#tainacan-text-name').type('Cat 1')
@ -62,7 +62,7 @@ context('Category field test', function(){
it('canceled create category-type field public', function(){ it('canceled create category-type field public', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -78,7 +78,7 @@ context('Category field test', function(){
it('create category-type field public - input type = radio', function(){ it('create category-type field public - input type = radio', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -96,7 +96,7 @@ context('Category field test', function(){
it('create category-type field public - input type = selectbox', function(){ it('create category-type field public - input type = selectbox', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -114,7 +114,7 @@ context('Category field test', function(){
it('create category-type field private', function(){ it('create category-type field private', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -132,7 +132,7 @@ context('Category field test', function(){
it('create category-type field public required', function(){ it('create category-type field public required', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -150,7 +150,7 @@ context('Category field test', function(){
it('create category-type field public multiple values', function(){ it('create category-type field public multiple values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -168,7 +168,7 @@ context('Category field test', function(){
it('create category-type field public unique values', function(){ it('create category-type field public unique values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -186,7 +186,7 @@ context('Category field test', function(){
it('check if fields are updated to page', function(){ it('check if fields are updated to page', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(7) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(7) > a').click()

View File

@ -9,7 +9,7 @@ describe('Date field test', function() {
it('create collection for create fields', function(){ it('create collection for create fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('#button-collection-creation').click() cy.get('#button-collection-creation').click()
cy.get('#tainacan-text-name').type('Date Fields') cy.get('#tainacan-text-name').type('Date Fields')
cy.get('#tainacan-text-description').type('Description Date Fields') cy.get('#tainacan-text-description').type('Description Date Fields')
@ -22,7 +22,7 @@ describe('Date field test', function() {
context('CRUD date field', function(){ context('CRUD date field', function(){
it('create submission date field', function(){ it('create submission date field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -37,7 +37,7 @@ describe('Date field test', function() {
it('check create submission date field', function(){ it('check create submission date field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -47,7 +47,7 @@ describe('Date field test', function() {
it('create year of manufacture field', function(){ it('create year of manufacture field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -62,7 +62,7 @@ describe('Date field test', function() {
it('check create year of manufacture field', function(){ it('check create year of manufacture field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -72,7 +72,7 @@ describe('Date field test', function() {
it('edit year of manufacture field', function(){ it('edit year of manufacture field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -87,7 +87,7 @@ describe('Date field test', function() {
it('create year field', function(){ it('create year field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -102,7 +102,7 @@ describe('Date field test', function() {
it('delete year field', function(){ it('delete year field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -114,7 +114,7 @@ describe('Date field test', function() {
it('check not contain year field', function(){ it('check not contain year field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -126,7 +126,7 @@ describe('Date field test', function() {
context('Diseble date field', function(){ context('Diseble date field', function(){
it('create purchase day field', function(){ it('create purchase day field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -141,7 +141,7 @@ describe('Date field test', function() {
it('disebled purchase day field', function(){ it('disebled purchase day field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -152,7 +152,7 @@ describe('Date field test', function() {
it('check disebled purchase day field', function(){ it('check disebled purchase day field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -164,7 +164,7 @@ describe('Date field test', function() {
context('Check required fields', function(){ context('Check required fields', function(){
it('create blank field', function(){ it('create blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -184,7 +184,7 @@ describe('Date field test', function() {
it('check not contain blank field', function(){ it('check not contain blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -196,7 +196,7 @@ describe('Date field test', function() {
context('Create date field private', function(){ context('Create date field private', function(){
it('create date private field', function(){ it('create date private field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -211,7 +211,7 @@ describe('Date field test', function() {
it('check create date private field', function(){ it('check create date private field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -225,7 +225,7 @@ describe('Date field test', function() {
context('"Not saved" label vs. "cancel button"', function(){ context('"Not saved" label vs. "cancel button"', function(){
it('create warranty field', function(){ it('create warranty field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -240,7 +240,7 @@ describe('Date field test', function() {
it('check that Not Saved label wasnt inserted, and changes were lost', function(){ it('check that Not Saved label wasnt inserted, and changes were lost', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -257,7 +257,7 @@ describe('Date field test', function() {
it('check if the message “Not Saved” appeared next to the field name', function(){ 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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -283,7 +283,7 @@ describe('Date field test', function() {
context('create date-types fields tests', function(){ context('create date-types fields tests', function(){
it('canceled create date field', function(){ it('canceled create date field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -298,7 +298,7 @@ describe('Date field test', function() {
it('create date-type field public required', function(){ it('create date-type field public required', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -314,7 +314,7 @@ describe('Date field test', function() {
it('create date-type field public multiple values', function(){ it('create date-type field public multiple values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -330,7 +330,7 @@ describe('Date field test', function() {
it('create date-type field public unique values', function(){ it('create date-type field public unique values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -348,7 +348,7 @@ describe('Date field test', function() {
context('Leave page without saving field editions', function(){ context('Leave page without saving field editions', function(){
it('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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -370,7 +370,7 @@ describe('Date field test', function() {
context('Field loading for paging and persistence testing', function(){ context('Field loading for paging and persistence testing', function(){
it('create dates fields', function(){ it('create dates fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -429,7 +429,7 @@ describe('Date field test', function() {
it('check if fields are updated to page', function(){ it('check if fields are updated to page', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()

View File

@ -9,7 +9,7 @@ describe('Numeric field test', function() {
it('create collection for create fields', function(){ it('create collection for create fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('#button-collection-creation').click() cy.get('#button-collection-creation').click()
cy.get('#tainacan-text-name').type('Numeric Fields') cy.get('#tainacan-text-name').type('Numeric Fields')
cy.get('#tainacan-text-description').type('Description Numeric Fields') cy.get('#tainacan-text-description').type('Description Numeric Fields')
@ -22,7 +22,7 @@ describe('Numeric field test', function() {
context('CRUD numeric field', function(){ context('CRUD numeric field', function(){
it('create counter field', function(){ it('create counter field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -37,7 +37,7 @@ describe('Numeric field test', function() {
it('check create counter field', function(){ it('check create counter field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -47,7 +47,7 @@ describe('Numeric field test', function() {
it('create code field', function(){ it('create code field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -62,7 +62,7 @@ describe('Numeric field test', function() {
it('check create code field', function(){ it('check create code field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -72,7 +72,7 @@ describe('Numeric field test', function() {
it('edit code field', function(){ it('edit code field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -87,7 +87,7 @@ describe('Numeric field test', function() {
it('create number field', function(){ it('create number field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -102,7 +102,7 @@ describe('Numeric field test', function() {
it('delete number field', function(){ it('delete number field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -114,7 +114,7 @@ describe('Numeric field test', function() {
it('check not contain year field', function(){ it('check not contain year field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -126,7 +126,7 @@ describe('Numeric field test', function() {
context('Diseble numeric field', function(){ context('Diseble numeric field', function(){
it('create registration number field', function(){ it('create registration number field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -141,7 +141,7 @@ describe('Numeric field test', function() {
it('disebled registration number field', function(){ it('disebled registration number field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -152,7 +152,7 @@ describe('Numeric field test', function() {
it('check disebled registration number field', function(){ it('check disebled registration number field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -164,7 +164,7 @@ describe('Numeric field test', function() {
context('Check required fields', function(){ context('Check required fields', function(){
it('create blank field', function(){ it('create blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -184,7 +184,7 @@ describe('Numeric field test', function() {
it('check not contain blank field', function(){ it('check not contain blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -196,7 +196,7 @@ describe('Numeric field test', function() {
context('Create numeric field private', function(){ context('Create numeric field private', function(){
it('create date private field', function(){ it('create date private field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -211,7 +211,7 @@ describe('Numeric field test', function() {
it('check create numeric private field', function(){ it('check create numeric private field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -225,7 +225,7 @@ describe('Numeric field test', function() {
context('"Not saved" label vs. "cancel button"', function(){ context('"Not saved" label vs. "cancel button"', function(){
it('create amount field', function(){ it('create amount field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -240,7 +240,7 @@ describe('Numeric field test', function() {
it('check that Not Saved label wasnt inserted, and changes were lost', function(){ it('check that Not Saved label wasnt inserted, and changes were lost', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -257,7 +257,7 @@ describe('Numeric field test', function() {
it('check if the message “Not Saved” appeared next to the field name', function(){ 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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -283,7 +283,7 @@ describe('Numeric field test', function() {
context('create date-types fields tests', function(){ context('create date-types fields tests', function(){
it('canceled create numeric field', function(){ it('canceled create numeric field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -298,7 +298,7 @@ describe('Numeric field test', function() {
it('create numeric-type field public required', function(){ it('create numeric-type field public required', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -314,7 +314,7 @@ describe('Numeric field test', function() {
it('create numeric-type field public multiple values', function(){ it('create numeric-type field public multiple values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -330,7 +330,7 @@ describe('Numeric field test', function() {
it('create numeric-type field public unique values', function(){ it('create numeric-type field public unique values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -348,7 +348,7 @@ describe('Numeric field test', function() {
context('Leave page without saving field editions', function(){ context('Leave page without saving field editions', function(){
it('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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -370,7 +370,7 @@ describe('Numeric field test', function() {
context('Field loading for paging and persistence testing', function(){ context('Field loading for paging and persistence testing', function(){
it('create numerics fields', function(){ it('create numerics fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -429,7 +429,7 @@ describe('Numeric field test', function() {
it('check if fields are updated to page', function(){ it('check if fields are updated to page', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()

View File

@ -9,7 +9,7 @@ context('Relationship field test', function(){
it('create collection for create fields', function(){ it('create collection for create fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('#button-collection-creation').click() cy.get('#button-collection-creation').click()
cy.get('#tainacan-text-name').type('Book Fields') cy.get('#tainacan-text-name').type('Book Fields')
cy.get('#tainacan-text-description').type('Descrição book Fields') cy.get('#tainacan-text-description').type('Descrição book Fields')
@ -21,7 +21,7 @@ context('Relationship field test', function(){
it('create collection for create relationship', function(){ it('create collection for create relationship', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.contains('New Collection').click() cy.contains('New Collection').click()
cy.get('#tainacan-text-name').type('Book relationship') cy.get('#tainacan-text-name').type('Book relationship')
cy.get('#tainacan-text-description').type('Descrição book relationship') cy.get('#tainacan-text-description').type('Descrição book relationship')
@ -33,7 +33,7 @@ context('Relationship field test', function(){
it('canceled create relationship-type field public', function(){ it('canceled create relationship-type field public', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click() 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(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -49,7 +49,7 @@ context('Relationship field test', function(){
it('create relationship-type field public', function(){ it('create relationship-type field public', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click() 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(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -68,7 +68,7 @@ context('Relationship field test', function(){
it('create relationship-type field private', function(){ it('create relationship-type field private', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click() 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(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -87,7 +87,7 @@ context('Relationship field test', function(){
it('create relationship-type field public required', function(){ it('create relationship-type field public required', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click() 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(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -107,7 +107,7 @@ context('Relationship field test', function(){
it('create relationship-type field public multiple values', function(){ it('create relationship-type field public multiple values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click() 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(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -127,7 +127,7 @@ context('Relationship field test', function(){
it('create relationship-type field public unique values', function(){ it('create relationship-type field public unique values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click() 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(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -147,7 +147,7 @@ context('Relationship field test', function(){
it('check if fields are updated to page', function(){ it('check if fields are updated to page', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get(':nth-child(2) > [data-label="Name"] > :nth-child(1) > .clickable-row').click() 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(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()

View File

@ -9,7 +9,7 @@ describe('Selectbox field test', function() {
it('create collection for create fields', function(){ it('create collection for create fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('#button-collection-creation').click() cy.get('#button-collection-creation').click()
cy.get('#tainacan-text-name').type('Selectbox Fields') cy.get('#tainacan-text-name').type('Selectbox Fields')
cy.get('#tainacan-text-description').type('Description Selectbox Fields') cy.get('#tainacan-text-description').type('Description Selectbox Fields')
@ -22,7 +22,7 @@ describe('Selectbox field test', function() {
context('CRUD selectbox field', function(){ context('CRUD selectbox field', function(){
it('create reviewed field', function(){ it('create reviewed field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -38,7 +38,7 @@ describe('Selectbox field test', function() {
it('check create reviewed field', function(){ it('check create reviewed field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -48,7 +48,7 @@ describe('Selectbox field test', function() {
it('create edited field', function(){ it('create edited field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -64,7 +64,7 @@ describe('Selectbox field test', function() {
it('check create edited field', function(){ it('check create edited field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -74,7 +74,7 @@ describe('Selectbox field test', function() {
it('edit edited field', function(){ it('edit edited field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -90,7 +90,7 @@ describe('Selectbox field test', function() {
it('create itsCool field', function(){ it('create itsCool field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -106,7 +106,7 @@ describe('Selectbox field test', function() {
it('delete itsCool field', function(){ it('delete itsCool field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -118,7 +118,7 @@ describe('Selectbox field test', function() {
it('check not contain itsCool field', function(){ it('check not contain itsCool field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -130,7 +130,7 @@ describe('Selectbox field test', function() {
context('Diseble selectbox field', function(){ context('Diseble selectbox field', function(){
it('create verified field', function(){ it('create verified field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -146,7 +146,7 @@ describe('Selectbox field test', function() {
it('disebled verified field', function(){ it('disebled verified field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -157,7 +157,7 @@ describe('Selectbox field test', function() {
it('check disebled verified field', function(){ it('check disebled verified field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -169,7 +169,7 @@ describe('Selectbox field test', function() {
context('Check required fields', function(){ context('Check required fields', function(){
it('create blank field', function(){ it('create blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -190,7 +190,7 @@ describe('Selectbox field test', function() {
it('check not contain blank field', function(){ it('check not contain blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -202,7 +202,7 @@ describe('Selectbox field test', function() {
context('Create selectbox field private', function(){ context('Create selectbox field private', function(){
it('create selectbox private field', function(){ it('create selectbox private field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -210,30 +210,29 @@ describe('Selectbox field test', function() {
cy.get('.field > :nth-child(2) > :nth-child(5)').click() cy.get('.field > :nth-child(2) > :nth-child(5)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Selectbox private') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Selectbox private')
cy.get('.textarea').type('description private') cy.get('.textarea').type('description private')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-private > .check').click()
//cy.get('#tainacan-select-status-private > .check').click()
cy.get('.autocomplete > .control > .input').type('yes{enter}no') cy.get('.autocomplete > .control > .input').type('yes{enter}no')
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.get('.active-fields-area >').should('contain', 'Selectbox private') cy.get('.active-fields-area >').should('contain', 'Selectbox private')
}) })
// it('check create selectbox private field', function(){ it('check create selectbox private field', function(){
// cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
// cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')})
// cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
// cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
// cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
// cy.get('h1').should('contain', 'Collection Fields Edition Page') cy.get('h1').should('contain', 'Collection Fields Edition Page')
// cy.get('.active-fields-area > :nth-child(6) > .handle > .field-name').should('contain', 'Selectbox private') cy.get('.active-fields-area > :nth-child(6) > .handle > .field-name').should('contain', 'Selectbox private')
// cy.get(':nth-child(6) > .handle > .controls > :nth-child(2) > .icon > .mdi').click() cy.get(':nth-child(6) > .handle > .controls > :nth-child(2) > .icon > .mdi').click()
// cy.get('#tainacan-select-status-private > .check').should('be.selected') cy.get('#tainacan-select-status-private > .check').should('be.selected')
// }) })
}) })
context('"Not saved" label vs. "cancel button"', function(){ context('"Not saved" label vs. "cancel button"', function(){
it('create likes field', function(){ it('create likes field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -249,7 +248,7 @@ describe('Selectbox field test', function() {
it('check that Not Saved label wasnt inserted, and changes were lost', function(){ it('check that Not Saved label wasnt inserted, and changes were lost', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -267,7 +266,7 @@ describe('Selectbox field test', function() {
it('check if the message “Not Saved” appeared next to the field name', function(){ 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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -295,7 +294,7 @@ describe('Selectbox field test', function() {
context('create selectbox-types fields tests', function(){ context('create selectbox-types fields tests', function(){
it('canceled create selectbox field', function(){ it('canceled create selectbox field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -311,7 +310,7 @@ describe('Selectbox field test', function() {
it('create selectbox-type field public required', function(){ it('create selectbox-type field public required', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -328,7 +327,7 @@ describe('Selectbox field test', function() {
it('create selectbox-type field public multiple values', function(){ it('create selectbox-type field public multiple values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -345,7 +344,7 @@ describe('Selectbox field test', function() {
it('create selectbox-type field public unique values', function(){ it('create selectbox-type field public unique values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -364,7 +363,7 @@ describe('Selectbox field test', function() {
context('Leave page without saving field editions', function(){ context('Leave page without saving field editions', function(){
it('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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -386,7 +385,7 @@ describe('Selectbox field test', function() {
context('Field loading for paging and persistence testing', function(){ context('Field loading for paging and persistence testing', function(){
it('create selectbox fields', function(){ it('create selectbox fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -455,7 +454,7 @@ describe('Selectbox field test', function() {
it('check if fields are updated to page', function(){ it('check if fields are updated to page', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()

View File

@ -9,7 +9,7 @@ describe('TextArea field test', function() {
it('create collection for create fields', function(){ it('create collection for create fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('#button-collection-creation').click() cy.get('#button-collection-creation').click()
cy.get('#tainacan-text-name').type('TextArea Fields') cy.get('#tainacan-text-name').type('TextArea Fields')
cy.get('#tainacan-text-description').type('Description TextArea Fields') cy.get('#tainacan-text-description').type('Description TextArea Fields')
@ -22,7 +22,7 @@ describe('TextArea field test', function() {
context('CRUD textArea field', function(){ context('CRUD textArea field', function(){
it('create model field', function(){ it('create model field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -37,7 +37,7 @@ describe('TextArea field test', function() {
it('check create model field', function(){ it('check create model field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -47,7 +47,7 @@ describe('TextArea field test', function() {
it('create color field', function(){ it('create color field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -62,7 +62,7 @@ describe('TextArea field test', function() {
it('check create color field', function(){ it('check create color field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -72,7 +72,7 @@ describe('TextArea field test', function() {
it('edit color field', function(){ it('edit color field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -87,7 +87,7 @@ describe('TextArea field test', function() {
it('create door field', function(){ it('create door field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -102,7 +102,7 @@ describe('TextArea field test', function() {
it('delete door field', function(){ it('delete door field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -114,7 +114,7 @@ describe('TextArea field test', function() {
it('check not contain door field', function(){ it('check not contain door field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -126,7 +126,7 @@ describe('TextArea field test', function() {
context('Diseble textArea field', function(){ context('Diseble textArea field', function(){
it('create motor field', function(){ it('create motor field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -141,7 +141,7 @@ describe('TextArea field test', function() {
it('disebled motor field', function(){ it('disebled motor field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -152,7 +152,7 @@ describe('TextArea field test', function() {
it('check disebled motor field', function(){ it('check disebled motor field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -164,7 +164,7 @@ describe('TextArea field test', function() {
context('Check required fields', function(){ context('Check required fields', function(){
it('create blank field', function(){ it('create blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -184,7 +184,7 @@ describe('TextArea field test', function() {
it('check not contain blank field', function(){ it('check not contain blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -196,7 +196,7 @@ describe('TextArea field test', function() {
context('Create textArea field private', function(){ context('Create textArea field private', function(){
it('create private field', function(){ it('create private field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -211,7 +211,7 @@ describe('TextArea field test', function() {
it('check create private field', function(){ it('check create private field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -225,7 +225,7 @@ describe('TextArea field test', function() {
context('"Not saved" label vs. "cancel button"', function(){ context('"Not saved" label vs. "cancel button"', function(){
it('create brand field', function(){ it('create brand field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -240,7 +240,7 @@ describe('TextArea field test', function() {
it('check that Not Saved label wasnt inserted, and changes were lost', function(){ it('check that Not Saved label wasnt inserted, and changes were lost', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -257,7 +257,7 @@ describe('TextArea field test', function() {
it('check if the message “Not Saved” appeared next to the field name', function(){ 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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -283,7 +283,7 @@ describe('TextArea field test', function() {
context('create textArea-types fields tests', function(){ context('create textArea-types fields tests', function(){
it('canceled create textArea field', function(){ it('canceled create textArea field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -298,7 +298,7 @@ describe('TextArea field test', function() {
it('create textArea-type field public required', function(){ it('create textArea-type field public required', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -314,7 +314,7 @@ describe('TextArea field test', function() {
it('create textArea-type field public multiple values', function(){ it('create textArea-type field public multiple values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -330,7 +330,7 @@ describe('TextArea field test', function() {
it('create textArea-type field public unique values', function(){ it('create textArea-type field public unique values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -348,7 +348,7 @@ describe('TextArea field test', function() {
context('Leave page without saving field editions', function(){ context('Leave page without saving field editions', function(){
it('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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -370,7 +370,7 @@ describe('TextArea field test', function() {
context('Field loading for paging and persistence testing', function(){ context('Field loading for paging and persistence testing', function(){
it('create textAreas fields', function(){ it('create textAreas fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -380,55 +380,46 @@ describe('TextArea field test', function() {
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(2)').click() cy.get('.field > :nth-child(2) > :nth-child(2)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 2') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 2')
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(2)').click() cy.get('.field > :nth-child(2) > :nth-child(2)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 3') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 3')
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(2)').click() cy.get('.field > :nth-child(2) > :nth-child(2)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 4') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 4')
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(2)').click() cy.get('.field > :nth-child(2) > :nth-child(2)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 5') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 5')
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(2)').click() cy.get('.field > :nth-child(2) > :nth-child(2)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 6') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 6')
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(2)').click() cy.get('.field > :nth-child(2) > :nth-child(2)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 7') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 7')
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(2)').click() cy.get('.field > :nth-child(2) > :nth-child(2)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 8') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 8')
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(2)').click() cy.get('.field > :nth-child(2) > :nth-child(2)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 9') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 9')
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(2)').click() cy.get('.field > :nth-child(2) > :nth-child(2)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 10') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}TextArea 10')
cy.get('.textarea').type('description textArea') cy.get('.textarea').type('description textArea')
@ -438,7 +429,7 @@ describe('TextArea field test', function() {
it('check if fields are updated to page', function(){ it('check if fields are updated to page', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()

View File

@ -9,7 +9,7 @@ describe('Text field test', function() {
it('create collection for create fields', function(){ it('create collection for create fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('#button-collection-creation').click() cy.get('#button-collection-creation').click()
cy.get('#tainacan-text-name').type('Book Text Fields') cy.get('#tainacan-text-name').type('Book Text Fields')
cy.get('#tainacan-text-description').type('Description book Fields') cy.get('#tainacan-text-description').type('Description book Fields')
@ -22,7 +22,7 @@ describe('Text field test', function() {
context('CRUD text field', function(){ context('CRUD text field', function(){
it('create actor field', function(){ it('create actor field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -37,7 +37,7 @@ describe('Text field test', function() {
it('check create actor field', function(){ it('check create actor field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -47,7 +47,7 @@ describe('Text field test', function() {
it('create location field', function(){ it('create location field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -62,7 +62,7 @@ describe('Text field test', function() {
it('check create location field', function(){ it('check create location field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -72,7 +72,7 @@ describe('Text field test', function() {
it('edit location field', function(){ it('edit location field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -87,7 +87,7 @@ describe('Text field test', function() {
it('create denomination field', function(){ it('create denomination field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -102,7 +102,7 @@ describe('Text field test', function() {
it('delete denomination field', function(){ it('delete denomination field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -114,7 +114,7 @@ describe('Text field test', function() {
it('check not contain denomination field', function(){ it('check not contain denomination field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -126,7 +126,7 @@ describe('Text field test', function() {
context('Diseble text field', function(){ context('Diseble text field', function(){
it('create record field', function(){ it('create record field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -141,7 +141,7 @@ describe('Text field test', function() {
it('disebled record field', function(){ it('disebled record field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -152,7 +152,7 @@ describe('Text field test', function() {
it('check disebled record field', function(){ it('check disebled record field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -164,7 +164,7 @@ describe('Text field test', function() {
context('Check required fields', function(){ context('Check required fields', function(){
it('create blank field', function(){ it('create blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -184,7 +184,7 @@ describe('Text field test', function() {
it('check not contain blank field', function(){ it('check not contain blank field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -196,7 +196,7 @@ describe('Text field test', function() {
context('Create text field private', function(){ context('Create text field private', function(){
it('create private field', function(){ it('create private field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -211,7 +211,7 @@ describe('Text field test', function() {
it('check create private field', function(){ it('check create private field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -225,7 +225,7 @@ describe('Text field test', function() {
context('"Not saved" label vs. "cancel button"', function(){ context('"Not saved" label vs. "cancel button"', function(){
it('create denomination field', function(){ it('create denomination field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -240,7 +240,7 @@ describe('Text field test', function() {
it('check that Not Saved label wasnt inserted, and changes were lost', function(){ it('check that Not Saved label wasnt inserted, and changes were lost', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -257,7 +257,7 @@ describe('Text field test', function() {
it('check if the message “Not Saved” appeared next to the field name', function(){ 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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -283,7 +283,7 @@ describe('Text field test', function() {
context('create text-type fields tests', function(){ context('create text-type fields tests', function(){
it('canceled create text field', function(){ it('canceled create text field', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -298,7 +298,7 @@ describe('Text field test', function() {
it('create text-type field public required', function(){ it('create text-type field public required', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -314,7 +314,7 @@ describe('Text field test', function() {
it('create text-type field public multiple values', function(){ it('create text-type field public multiple values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -330,7 +330,7 @@ describe('Text field test', function() {
it('create text-type field public unique values', function(){ it('create text-type field public unique values', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -348,7 +348,7 @@ describe('Text field test', function() {
context('Leave page without saving field editions', function(){ context('Leave page without saving field editions', function(){
it('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.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -370,7 +370,7 @@ describe('Text field test', function() {
context('Field loading for paging and persistence testing', function(){ context('Field loading for paging and persistence testing', function(){
it('create texts fields', function(){ it('create texts fields', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()
@ -380,55 +380,46 @@ describe('Text field test', function() {
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('[draggable="false"]').click() cy.get('[draggable="false"]').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 2') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 2')
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('[draggable="false"]').click() cy.get('[draggable="false"]').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 3') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 3')
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('[draggable="false"]').click() cy.get('[draggable="false"]').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 4') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 4')
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('[draggable="false"]').click() cy.get('[draggable="false"]').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 5') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 5')
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('[draggable="false"]').click() cy.get('[draggable="false"]').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 6') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 6')
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('[draggable="false"]').click() cy.get('[draggable="false"]').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 7') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 7')
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('[draggable="false"]').click() cy.get('[draggable="false"]').click()
/cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 8') /cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 8')
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('[draggable="false"]').click() cy.get('[draggable="false"]').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 9') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 9')
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
cy.get('#tainacan-select-status-publish > .check').click() cy.get('#tainacan-select-status-publish > .check').click()
cy.get(':nth-child(2) > .button').click() cy.get(':nth-child(2) > .button').click()
cy.wait(500)
cy.get('.field > :nth-child(2) > :nth-child(1)').click() cy.get('.field > :nth-child(2) > :nth-child(1)').click()
cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 10') cy.get('#fieldEditForm > :nth-child(1) > .control > .input').type('{selectall}{del}Text 10')
cy.get('.textarea').type('description text') cy.get('.textarea').type('description text')
@ -438,7 +429,7 @@ describe('Text field test', function() {
it('check if fields are updated to page', function(){ it('check if fields are updated to page', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location().should((loc) => {expect(loc.hash).to.eq('#/collections')}) cy.location('hash').should('eq', '#/collections')
cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click() cy.get('[data-label="Name"] > :nth-child(1) > .clickable-row').click()
cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items') cy.get(':nth-child(4) > .router-link-active').should('contain', 'Items')
cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click() cy.get('.menu > :nth-child(2) > :nth-child(5) > a').click()

View File

@ -7,38 +7,20 @@ describe('Item tests', function () {
cy.clearDB() cy.clearDB()
}) })
Cypress.Commands.add('createCollection', (name) => { it('create collection for crud items', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')
cy.location('hash').should('eq', '#/collections') cy.location('hash').should('eq', '#/collections')
cy.get('#button-collection-creation').click() cy.get('#button-collection-creation').click()
cy.location('hash').should('eq', '#/collections/new') cy.location('hash').should('eq', '#/collections/new')
cy.get('#tainacan-text-name').type(name) cy.get('#tainacan-text-name').type('Book Items')
cy.get('#tainacan-text-description').type('description'+name) cy.get('#tainacan-text-description').type('description book items')
cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish') cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
cy.get('#button-submit-collection-creation').click() cy.get('#button-submit-collection-creation').click()
cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click() cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click()
cy.location('hash').should('eq', '#/collections') cy.location('hash').should('eq', '#/collections')
cy.get('.b-table').should('contain', name) cy.get('.b-table').should('contain', 'Book Items')
}) })
it('create collection', function(){
cy.createCollection('Book itens')
})
// 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.location('hash').should('eq', '#/collections/new')
// cy.get('#tainacan-text-name').type('Book Items')
// cy.get('#tainacan-text-description').type('description book items')
// cy.get('#tainacan-select-status').select('Publish').should('have.value', 'publish')
// cy.get('#button-submit-collection-creation').click()
// cy.get('.breadcrumbs > :nth-child(2) > .router-link-active').click()
// cy.location('hash').should('eq', '#/collections')
// cy.get('.b-table').should('contain', 'Book Items')
// })
context('CRUD items', function(){ context('CRUD items', function(){
it('canceled create item', function(){ it('canceled create item', function(){
cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections') cy.visit('/wp-admin/admin.php?page=tainacan_admin#/collections')

View File

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
if [ $# - lt 2 ]; then if [ $# -lt 1 ]; then
echo "usage: $0 [skip-head]" echo -e "* Enter <OPTION> 1 to open the cypress test suite.\n* Enter <OPTION> 2 to run all headless tests on the temrinal.\n* Enter <OPTION> 3 to run a specific test class, and enter the <PATH> for the class you want from cypress/integration/repository/<PATH>."
exit 1 exit 1
fi fi
SKIP_HEAD=${1-1} OPTION=$1
source build-config.cfg source build-config.cfg
@ -37,12 +37,15 @@ wp option add wpress_prefix $test_db_prefix
cd - cd -
# cypress beginning # cypress beginning
if [ ${SKIP_HEAD} = "0" ] if [ "$OPTION" == "1" ]; then
then ./node_modules/.bin/cypress open --config baseUrl=$wp_url
# ./node_modules/.bin/cypress run --config baseUrl=$wp_url --record --key $cy_record_key elif [ "$OPTION" == "2" ]; then
./node_modules/.bin/cypress run --spec cypress/integration/repository/collection/field/field_text_spec.js --config baseUrl=$wp_url ./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
else else
./node_modules/.bin/cypress open --config baseUrl=$wp_url echo -e "\nThe parameters provided are invalid\n"
fi fi
################## teardown cypress environment ################## teardown cypress environment

View File

@ -5,4 +5,4 @@ phpunit
echo "Running integration tests headless in Crypess..." echo "Running integration tests headless in Crypess..."
# the value 0 leaves the cypress headless # the value 0 leaves the cypress headless
./run-cypress.sh 0 ./run-cypress.sh 2

View File

@ -221,7 +221,7 @@ export default {
@import "../../scss/_variables.scss"; @import "../../scss/_variables.scss";
.table-thumb { .table-thumb {
max-height: 38px !important; max-height: 55px !important;
vertical-align: middle !important; vertical-align: middle !important;
} }

View File

@ -10,6 +10,7 @@
<!--</b-field>--> <!--</b-field>-->
<b-table <b-table
v-if="totalEvents > 0"
ref="eventsTable" ref="eventsTable"
:data="events" :data="events"
:checked-rows.sync="selectedEvents" :checked-rows.sync="selectedEvents"
@ -21,32 +22,19 @@
<b-table-column <b-table-column
tabindex="0" tabindex="0"
:label="$i18n.get('label_name')" :label="$i18n.get('label_event_title')"
:aria-label="$i18n.get('label_name')" :aria-label="$i18n.get('label_event_title')"
field="props.row.title"> field="props.row.title">
<router-link <router-link
class="clickable-row" class="clickable-row"
tag="span" tag="span"
router-link-active
:active="props.row.log_diff.length > 0"
:to="{path: $routerHelper.getEventPath(props.row.id)}"> :to="{path: $routerHelper.getEventPath(props.row.id)}">
{{ props.row.title }} {{ props.row.title }}
</router-link> </router-link>
</b-table-column> </b-table-column>
<b-table-column
tabindex="0"
:aria-label="$i18n.get('label_description')"
:label="$i18n.get('label_description')"
property="description"
show-overflow-tooltip
field="props.row.description">
<router-link
class="clickable-row"
tag="span"
:to="{path: $routerHelper.getEventPath(props.row.id)}">
{{ props.row.description }}
</router-link>
</b-table-column>
<b-table-column <b-table-column
class="row-creation" class="row-creation"
tabindex="0" tabindex="0"
@ -59,6 +47,7 @@
class="clickable-row" class="clickable-row"
v-html="props.row.by" v-html="props.row.by"
tag="span" tag="span"
:active="props.row.log_diff.length > 0"
:to="{path: $routerHelper.getEventPath(props.row.id)}"/> :to="{path: $routerHelper.getEventPath(props.row.id)}"/>
</b-table-column> </b-table-column>
@ -78,19 +67,28 @@
<a <a
id="button-not-approve" id="button-not-approve"
class="delete"
:aria-label="$i18n.get('not_approve_item')" :aria-label="$i18n.get('not_approve_item')"
@click.prevent.stop="notApprove(props.row.id)"> @click.prevent.stop="notApprove(props.row.id)" />
<b-icon
type="is-danger"
icon="close-circle-outline" />
</a>
</b-table-column> </b-table-column>
</template> </template>
</b-table> </b-table>
<section
v-if="totalEvents <= 0 || !totalEvents"
class="hero is-bold is-large">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title">
<b-icon icon="notifications-none" />
{{ this.$i18n.get('info_no_events') }}
</h1>
</div>
</div>
</section>
</div> </div>
</template> </template>

View File

@ -28,17 +28,18 @@
:custom-key="column.slug" :custom-key="column.slug"
:label="column.name" :label="column.name"
:visible="column.visible" :visible="column.visible"
:width="column.field == 'row_actions' ? 78 : column.field == 'featured_image' ? 55 : undefined "> :class="column.field == 'row_creation' ? 'row-creation' : ''"
:width="column.field == 'row_actions' ? 78 : column.field == 'row_thumbnail' ? 55 : undefined ">
<template> <template>
<span <span
class="clickable-row" class="clickable-row"
@click.prevent="goToItemPage(props.row.id)" @click.prevent="goToItemPage(props.row.id)"
v-if="column.field != 'featured_image' && column.field != 'row_actions'" v-if="column.field != 'row_thumbnail' && column.field != 'row_actions' && column.field != 'row_creation'"
v-html="renderMetadata( props.row.metadata[column.slug] )" /> v-html="renderMetadata( props.row.metadata[column.slug] )" />
</template> </template>
<template v-if="column.field == 'featured_image'"> <template v-if="column.field == 'row_thumbnail'">
<router-link <router-link
tag="img" tag="img"
class="table-thumb clickable-row" class="table-thumb clickable-row"
@ -46,20 +47,32 @@
:src="props.row[column.slug]"/> :src="props.row[column.slug]"/>
</template> </template>
<template
class="row-creation"
v-if="column.field == 'row_creation'">
<router-link
class="clickable-row"
v-html="getCreationHtml(props.row)"
tag="span"
:to="{path: $routerHelper.getItemPath(collectionId, props.row.id)}"/>
</template>
<template v-if="column.field == 'row_actions'"> <template v-if="column.field == 'row_actions'">
<!-- <a id="button-view" @click.prevent.stop="goToItemPage(props.row.id)"><b-icon icon="eye"></a> --> <!-- <a id="button-view" @click.prevent.stop="goToItemPage(props.row.id)"><b-icon icon="eye"></a> -->
<a <a
id="button-edit" id="button-edit"
:aria-label="$i18n.getFrom('items','edit_item')" :aria-label="$i18n.getFrom('items','edit_item')"
@click="goToItemEditPage(props.row.id)"><b-icon @click="goToItemEditPage(props.row.id)">
type="is-gray" <b-icon
icon="pencil"/></a> type="is-gray"
icon="pencil"/></a>
<a <a
id="button-delete" id="button-delete"
:aria-label="$i18n.get('label_button_delete')" :aria-label="$i18n.get('label_button_delete')"
@click="deleteOneItem(props.row.id)"><b-icon @click="deleteOneItem(props.row.id)">
type="is-gray" <b-icon
icon="delete"/></a> type="is-gray"
icon="delete"/></a>
</template> </template>
</b-table-column> </b-table-column>
</template> </template>
@ -69,6 +82,7 @@
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import moment from 'moment';
export default { export default {
name: 'ItemsList', name: 'ItemsList',
@ -163,17 +177,31 @@ export default {
return ''; return '';
else else
return metadata.value_as_html; return metadata.value_as_html;
},
getCreationHtml(item) {
return this.$i18n.get('info_created_by') + item['author_name'] + '<br>' + this.$i18n.get('info_date') + moment( item['creation_date'], 'YYYY-MM-DD').format('DD/MM/YYYY');
} }
} }
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
@import "../../scss/_variables.scss";
.table-thumb { .table-thumb {
max-height: 55px !important; max-height: 55px !important;
}
td {
vertical-align: middle !important; vertical-align: middle !important;
} }
.row-creation span {
color: $gray-light;
font-size: 0.75em;
line-height: 1.5
}
.clickable-row{ cursor: pointer !important } .clickable-row{ cursor: pointer !important }
</style> </style>

View File

@ -0,0 +1,99 @@
<template>
<div>
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile notification is-child is-light">
<div class="content">
<div class="title">{{ this.$i18n.get('info_logs_before') }}</div>
<div
v-for="(diff, key) in event.log_diff"
v-if="diff.old"
:key="key">
<p/>
<div class="has-text-weight-bold is-capitalized">{{ `${key.replace('_', ' ')}:` }}</div>
<div
v-if="!Array.isArray(diff.old)"
class="content is-inline">
{{ diff.old }}
</div>
<div
v-else
v-for="(o, ind) in diff.old"
:key="ind">
<div
class="content is-inline is-capitalized"
v-for="(o2, ind2) in o"
:key="ind2">
<div class="is-inline is-capitalized">{{ `${ind2.replace('_', ' ')}: ${o2} ` }}</div>
</div>
</div>
</div>
</div>
</article>
</div>
<div class="tile is-parent">
<article class="tile notification is-child is-light">
<div class="content">
<div class="title">{{ this.$i18n.get('info_logs_after') }}</div>
<div
v-for="(diff, key) in event.log_diff"
:key="key">
<p/>
<div
class="has-text-weight-bold is-capitalized"
:class="{ 'has-text-success': !diff.old, 'back-hlight': !diff.old }">
{{ `${key.replace('_', ' ')}:` }}
</div>
<div
v-for="(d, i) in diff.new"
:key="i"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }"
class="content is-inline" >
<div
class="is-inline has-text-success"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }"
v-if="!Array.isArray(d) && d.constructor.name !== 'Object' ">{{ d }}
</div>
<div
v-else
v-for="(e, i2) in d"
:key="i2"
class="is-inline">
<div
class="is-capitalized is-inline has-text-success"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }">
{{ `${i2.replace('_', ' ')}: ${e} ` }}
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</template>
<script>
export default {
name: "EventSplit",
props: {
event: Object
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,89 @@
<template>
<div>
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile notification is-child is-light">
<div class="content">
<div class="title">Changes</div>
<div
v-for="(diff, key) in event.log_diff"
v-if="diff.old"
:key="key">
<p/>
<div class="has-text-weight-bold is-capitalized">{{ `${key.replace('_', ' ')}:` }}</div>
<div
v-if="!Array.isArray(diff.old)"
class="content is-inline">
{{ diff.old }}
</div>
<div
v-else
v-for="(o, ind) in diff.old"
:key="ind">
<div
class="content is-inline is-capitalized"
v-for="(o2, ind2) in o"
:key="ind2">
<div class="is-inline is-capitalized">{{ `${ind2.replace('_', ' ')}: ${o2} ` }}</div>
</div>
</div>
</div>
<div
v-for="(diff, key) in event.log_diff"
:key="key">
<p/>
<div
class="has-text-weight-bold is-capitalized"
:class="{ 'has-text-success': !diff.old, 'back-hlight': !diff.old }">
{{ `${key.replace('_', ' ')}:` }}
</div>
<div
v-for="(d, i) in diff.new"
:key="i"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }"
class="content is-inline" >
<div
class="is-inline has-text-success"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }"
v-if="!Array.isArray(d) && d.constructor.name !== 'Object' ">{{ d }}
</div>
<div
v-else
v-for="(e, i2) in d"
:key="i2"
class="is-capitalized has-text-success"
:class="{ 'back-hlight': diff.diff_with_index.hasOwnProperty(i) }">
{{ `${i2.replace('_', ' ')}: ${e} ` }}
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</template>
<script>
export default {
name: "EventUnified",
props: {
event: Object
}
}
</script>
<style scoped>
</style>

View File

@ -1,56 +1,21 @@
<template> <template>
<div> <div>
<div v-if="filters.length > 0"> <tainacan-filter-item
<tainacan-filter-item :query="getPostQuery()"
v-for="(filter, index) in filters"
:key="index"
:filter="filter"/>
:query="getPostQuery()"
v-for="(filter, index) in filters"
:key="index"
:filter="filter"/>
</div>
<section
v-else
class="is-grouped-centered section">
<div class="content has-text-gray has-text-centered">
<p>
<b-icon
icon="filter-outline"
size="is-large"/>
</p>
<p>{{ $i18n.get('info_there_is_no_filter' ) }}</p>
<router-link
id="button-create-filter"
:to="isRepositoryLevel ? $routerHelper.getNewFilterPath() : $routerHelper.getNewCollectionFilterPath(collectionId)"
tag="button"
class="button is-secondary is-centered">
{{ $i18n.getFrom('filters', 'new_item') }}</router-link>
</div>
</section>
</div> </div>
</template> </template>
<script> <script>
import { mapActions, mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
data(){ props: {
return { filters: Array
collectionId: null,
filters: []
}
},
created(){
this.collectionId = ( this.$route.params.collectionId ) ? this.$route.params.collectionId : null;
this.fetchFilters( { collectionId: this.collectionId, isRepositoryLevel: !( this.collectionId ), isContextEdit: true })
.then( res => {
if( res && res.length > 0){
this.filters = res;
}
} );
}, },
methods: { methods: {
...mapActions('filter',[
'fetchFilters'
]),
...mapGetters('search',[ ...mapGetters('search',[
'getPostQuery' 'getPostQuery'
]) ])

View File

@ -37,7 +37,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { eventSearchBus } from '../../../js/event-search-bus'; import { eventBusSearch } from '../../../js/event-bus-search';
export default { export default {
name: 'Pagination', name: 'Pagination',
@ -59,7 +59,7 @@ export default {
watch: { watch: {
page( value ){ page( value ){
if (value < 1) if (value < 1)
eventSearchBus.setPage(1); eventBusSearch.setPage(1);
} }
}, },
methods: { methods: {
@ -75,13 +75,13 @@ export default {
} }
let prevValue = this.itemsPerPage; let prevValue = this.itemsPerPage;
eventSearchBus.setItemsPerPage(value); eventBusSearch.setItemsPerPage(value);
this.$userPrefs.set('items_per_page', value, prevValue); this.$userPrefs.set('items_per_page', value, prevValue);
}, },
onPageChange(page) { onPageChange(page) {
if(page == 0) if(page == 0)
return; return;
eventSearchBus.setPage(page); eventBusSearch.setPage(page);
}, },
getLastItemNumber() { getLastItemNumber() {
let last = (Number(this.itemsPerPage*(this.page - 1)) + Number(this.itemsPerPage)); let last = (Number(this.itemsPerPage*(this.page - 1)) + Number(this.itemsPerPage));

View File

@ -27,15 +27,16 @@
@input="onChangeOrderBy($event)" @input="onChangeOrderBy($event)"
:placeholder="$i18n.get('label_sorting')"> :placeholder="$i18n.get('label_sorting')">
<option <option
v-for="(field, index) in tableFields" v-for="field in tableFields"
v-if=" v-if="
field.id == 'date' || (
field.id != undefined && field.id != undefined &&
field.field_type_object.related_mapped_prop != 'description' && field.field_type_object.related_mapped_prop != 'description' &&
field.field_type_object.primitive_type != 'term' && field.field_type_object.primitive_type != 'term' &&
field.field_type_object.primitive_type != 'item' && field.field_type_object.primitive_type != 'item' &&
field.field_type_object.primitive_type != 'compound'" field.field_type_object.primitive_type != 'compound')"
:value="field" :value="field"
:key="index"> :key="field.id">
{{ field.name }} {{ field.name }}
</option> </option>
</b-select> </b-select>
@ -51,7 +52,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { eventSearchBus } from '../../../js/event-search-bus'; import { eventBusSearch } from '../../../js/event-bus-search';
export default { export default {
name: 'SearchControl', name: 'SearchControl',
@ -79,10 +80,10 @@ export default {
'getOrder' 'getOrder'
]), ]),
onChangeOrderBy(field) { onChangeOrderBy(field) {
eventSearchBus.setOrderBy(field); eventBusSearch.setOrderBy(field);
}, },
onChangeOrder() { onChangeOrder() {
this.order == 'DESC' ? eventSearchBus.setOrder('ASC') : eventSearchBus.setOrder('DESC'); this.order == 'DESC' ? eventBusSearch.setOrder('ASC') : eventBusSearch.setOrder('DESC');
} }
} }
} }

View File

@ -150,8 +150,8 @@ export default {
@import '../../scss/_variables.scss'; @import '../../scss/_variables.scss';
.sub-header { .sub-header {
max-height: $header-height; min-height: $subheader-height;
height: $header-height; height: $subheader-height;
margin-left: -$page-small-side-padding; margin-left: -$page-small-side-padding;
margin-right: -$page-small-side-padding; margin-right: -$page-small-side-padding;
margin-top: -$page-small-top-padding; margin-top: -$page-small-top-padding;

View File

@ -2,9 +2,10 @@
<div <div
class="page-container-small" class="page-container-small"
:class="{'primary-page': isRepositoryLevel}"> :class="{'primary-page': isRepositoryLevel}">
<div <div class="sub-header">
class="sub-header" <b-loading
v-if="items.length > 0"> :is-full-page="false"
:active.sync="isLoadingFields"/>
<div class="header-item"> <div class="header-item">
<router-link <router-link
id="button-create-item" id="button-create-item"
@ -15,7 +16,7 @@
</router-link> </router-link>
</div> </div>
<search-control <search-control
v-if="items.length > 0" v-if="fields.length > 0 && (items.length != 0 || isLoadingItems)"
:is-repository-level="isRepositoryLevel" :is-repository-level="isRepositoryLevel"
:collection-id="collectionId" :collection-id="collectionId"
:table-fields="tableFields" :table-fields="tableFields"
@ -23,11 +24,37 @@
</div> </div>
<div class="columns"> <div class="columns">
<aside class="column filters-menu"> <aside class="column filters-menu">
<b-loading
:is-full-page="false"
:active.sync="isLoadingFilters"/>
<h3>{{ $i18n.get('filters') }}</h3> <h3>{{ $i18n.get('filters') }}</h3>
<filters-items-list /> <filters-items-list
v-if="filters.length > 0"
:filters="filters"/>
<section
v-else
class="is-grouped-centered section">
<div class="content has-text-gray has-text-centered">
<p>
<b-icon
icon="filter-outline"
size="is-large"/>
</p>
<p>{{ $i18n.get('info_there_is_no_filter' ) }}</p>
<router-link
id="button-create-filter"
:to="isRepositoryLevel ? $routerHelper.getNewFilterPath() : $routerHelper.getNewCollectionFilterPath(collectionId)"
tag="button"
class="button is-secondary is-centered">
{{ $i18n.getFrom('filters', 'new_item') }}</router-link>
</div>
</section>
</aside> </aside>
<div class="column"> <div class="column">
<div class="table-container above-subheader"> <div class="table-container above-subheader">
<b-loading
:is-full-page="false"
:active.sync="isLoadingItems"/>
<items-list <items-list
v-if="items.length > 0" v-if="items.length > 0"
:collection-id="collectionId" :collection-id="collectionId"
@ -43,8 +70,9 @@
icon="inbox" icon="inbox"
size="is-large"/> size="is-large"/>
</p> </p>
<p>{{ $i18n.get('info_no_item_created') }}</p> <p>{{ hasFiltered ? $i18n.get('info_no_item_found') : $i18n.get('info_no_item_created') }}</p>
<router-link <router-link
v-if="!hasFiltered"
id="button-create-item" id="button-create-item"
tag="button" tag="button"
class="button is-primary" class="button is-primary"
@ -66,7 +94,7 @@ import SearchControl from '../../components/search/search-control.vue'
import ItemsList from '../../components/lists/items-list.vue'; import ItemsList from '../../components/lists/items-list.vue';
import FiltersItemsList from '../../components/search/filters-items-list.vue'; import FiltersItemsList from '../../components/search/filters-items-list.vue';
import Pagination from '../../components/search/pagination.vue' import Pagination from '../../components/search/pagination.vue'
import { eventSearchBus } from '../../../js/event-search-bus' import { eventBusSearch } from '../../../js/event-bus-search'
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
export default { export default {
@ -77,7 +105,10 @@ export default {
isRepositoryLevel: false, isRepositoryLevel: false,
tableFields: [], tableFields: [],
prefTableFields: [], prefTableFields: [],
isLoading: false isLoadingItems: false,
isLoadingFilters: false,
isLoadingFields: false,
hasFiltered: false
} }
}, },
components: { components: {
@ -87,38 +118,63 @@ export default {
Pagination Pagination
}, },
methods: { methods: {
...mapActions('collection', [
'fetchItems',
]),
...mapGetters('collection', [ ...mapGetters('collection', [
'getItems' 'getItems'
]), ]),
...mapActions('fields', [ ...mapActions('fields', [
'fetchFields' 'fetchFields'
]), ]),
...mapGetters('fields', [
'getFields'
]),
...mapActions('filter',[
'fetchFilters'
]),
...mapGetters('filter', [
'getFilters'
])
}, },
computed: { computed: {
items(){ items(){
return this.getItems(); return this.getItems();
},
filters(){
return this.getFilters();
},
fields() {
return this.getFields();
} }
}, },
created() { created() {
this.collectionId = this.$route.params.collectionId; this.collectionId = this.$route.params.collectionId;
this.isRepositoryLevel = (this.collectionId == undefined); this.isRepositoryLevel = (this.collectionId == undefined);
eventSearchBus.$on('isLoadingItems', isLoadingItems => { eventBusSearch.$on('isLoadingItems', isLoadingItems => {
this.isLoading = isLoadingItems; this.isLoadingItems = isLoadingItems;
}); });
this.fetchFields({ collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel, isContextEdit: false }).then((res) => { eventBusSearch.$on('hasFiltered', hasFiltered => {
let rawFields = res; this.hasFiltered = hasFiltered;
this.tableFields.push({ name: this.$i18n.get('label_thumbnail'), field: 'featured_image', field_type: undefined, slug: 'featured_image', id: undefined, visible: true }); });
for (let field of rawFields) {
this.isLoadingFilters = true;
this.fetchFilters( { collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel, isContextEdit: true })
.then(() => this.isLoadingFilters = false)
.catch(() => this.isLoadingFilters = false);
this.isLoadingFields = true;
this.fetchFields({ collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel, isContextEdit: false }).then(() => {
this.tableFields.push({ name: this.$i18n.get('label_thumbnail'), field: 'row_thumbnail', field_type: undefined, slug: 'featured_image', id: undefined, visible: true });
for (let field of this.fields) {
this.tableFields.push( this.tableFields.push(
{name: field.name, field: field.description, slug: field.slug, field_type: field.field_type, field_type_object: field.field_type_object, id: field.id, visible: true } {name: field.name, field: field.description, slug: field.slug, field_type: field.field_type, field_type_object: field.field_type_object, id: field.id, visible: true }
); );
} }
this.tableFields.push({ name: this.$i18n.get('label_creation'), field: 'row_creation', field_type: undefined, slug: 'creation', id: 'date', visible: true});
this.tableFields.push({ name: this.$i18n.get('label_actions'), field: 'row_actions', field_type: undefined, slug: 'actions', id: undefined, visible: true }); this.tableFields.push({ name: this.$i18n.get('label_actions'), field: 'row_actions', field_type: undefined, slug: 'actions', id: undefined, visible: true });
//this.prefTableFields = this.tableFields; //this.prefTableFields = this.tableFields;
// this.$userPrefs.get('table_columns_' + this.collectionId) // this.$userPrefs.get('table_columns_' + this.collectionId)
// .then((value) => { // .then((value) => {
@ -127,12 +183,15 @@ export default {
// .catch((error) => { // .catch((error) => {
// this.$userPrefs.set('table_columns_' + this.collectionId, this.prefTableFields, null); // this.$userPrefs.set('table_columns_' + this.collectionId, this.prefTableFields, null);
// }); // });
this.isLoadingFields = false;
}).catch(); }).catch(() => {
this.isLoadingFields = false;
});
}, },
mounted(){ mounted(){
eventSearchBus.updateStoreFromURL(); eventBusSearch.updateStoreFromURL();
eventSearchBus.loadItems(); eventBusSearch.loadItems();
} }
} }
@ -148,7 +207,7 @@ export default {
} }
.sub-header { .sub-header {
max-height: $subheader-height; min-height: $subheader-height;
height: $subheader-height; height: $subheader-height;
margin-left: -$page-small-side-padding; margin-left: -$page-small-side-padding;
margin-right: -$page-small-side-padding; margin-right: -$page-small-side-padding;
@ -157,6 +216,7 @@ export default {
padding-left: $page-small-side-padding; padding-left: $page-small-side-padding;
padding-right: $page-small-side-padding; padding-right: $page-small-side-padding;
border-bottom: 0.5px solid #ddd; border-bottom: 0.5px solid #ddd;
position: relative;
@media screen and (max-width: 769px) { @media screen and (max-width: 769px) {
height: 60px; height: 60px;
@ -177,6 +237,7 @@ export default {
} }
.filters-menu { .filters-menu {
position: relative;
min-width: $side-menu-width; min-width: $side-menu-width;
max-width: $side-menu-width; max-width: $side-menu-width;
background-color: $tainacan-input-color; background-color: $tainacan-input-color;
@ -193,6 +254,7 @@ export default {
.table-container { .table-container {
margin-right: -$page-small-side-padding; margin-right: -$page-small-side-padding;
padding: 3em 2.5em; padding: 3em 2.5em;
position: relative;
} }
@media screen and (max-width: 769px) { @media screen and (max-width: 769px) {

View File

@ -2,50 +2,22 @@
<div> <div>
<div class="is-fullheight"> <div class="is-fullheight">
<div class="page-container primary-page"> <div class="page-container primary-page">
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile notification is-child is-light">
<div class="content">
<div class="title">Before change</div>
<div
v-for="(diff, key) in event.log_diff"
v-if="diff.old"
:key="key">
<p/> <div class="">
<div class="has-text-weight-bold is-capitalized">{{ `${key.replace('_', ' ')}:` }}</div> <div class="field">
<div class="content">{{ diff.old }}</div> <b-switch
</div> v-model="comp"
</div> true-value="Unified"
</article> false-value="Split"
</div> class="is-pulled-right">
{{ comp }}
<div class="tile is-parent"> </b-switch>
<article class="tile notification is-child is-light">
<div class="content">
<div class="title">What was changed</div>
<div
v-for="(diff, key) in event.log_diff"
:key="key">
<p/>
<div
class="has-text-weight-bold is-capitalized"
:class="{'has-text-success': !diff.old }">
{{ `${key.replace('_', ' ')}:` }}
</div>
<div
v-for="(d, i) in diff.new"
:key="i"
:class="{'has-text-success': diff.diff_with_index.hasOwnProperty(i) }"
class="content is-inline" >
{{ d }}
</div>
</div>
</div>
</article>
</div> </div>
</div> </div>
<component
:is="comp"
:event="event" />
</div> </div>
</div> </div>
</div> </div>
@ -54,11 +26,15 @@
<script> <script>
import {mapActions, mapGetters} from 'vuex'; import {mapActions, mapGetters} from 'vuex';
import Split from '../../components/other/event-diff/event-split.vue';
import Unified from '../../components/other/event-diff/event-unified.vue';
export default { export default {
name: 'EventPage', name: 'EventPage',
data() { data() {
return { return {
eventId: Number, eventId: Number,
comp: 'Split',
} }
}, },
methods: { methods: {
@ -74,6 +50,10 @@
return this.getEvent(); return this.getEvent();
} }
}, },
components: {
Split,
Unified
},
created() { created() {
this.eventId = parseInt(this.$route.params.eventId); this.eventId = parseInt(this.$route.params.eventId);
@ -83,6 +63,8 @@
} }
</script> </script>
<style scoped> <style>
.back-hlight {
background-color: rgb(231, 255, 237);
}
</style> </style>

View File

@ -134,6 +134,7 @@ return [
'label_inherited' => __( 'Inherited', 'tainacan' ), 'label_inherited' => __( 'Inherited', 'tainacan' ),
'label_sorting' => __( 'Sorting', 'tainacan' ), 'label_sorting' => __( 'Sorting', 'tainacan' ),
'label_who_when' => __( 'Who and when', 'tainacan' ), 'label_who_when' => __( 'Who and when', 'tainacan' ),
'label_event_title' => __( 'Event', 'tainacan' ),
// Instructions. More complex sentences to guide user and placeholders // Instructions. More complex sentences to guide user and placeholders
'instruction_dragndrop_fields_collection' => __( 'Drag and drop Fields here to Collection.', 'tainacan' ), 'instruction_dragndrop_fields_collection' => __( 'Drag and drop Fields here to Collection.', 'tainacan' ),
@ -153,6 +154,7 @@ return [
'info_no_collection_created' => __( 'No collection was created in this repository.', 'tainacan' ), 'info_no_collection_created' => __( 'No collection was created in this repository.', 'tainacan' ),
'info_no_category_created' => __( 'No category was created in this repository.', 'tainacan' ), 'info_no_category_created' => __( 'No category was created in this repository.', 'tainacan' ),
'info_no_item_created' => __( 'No item was created in this collection.', 'tainacan' ), 'info_no_item_created' => __( 'No item was created in this collection.', 'tainacan' ),
'info_no_item_found' => __( 'No item was found here with these filters.', 'tainacan' ),
'info_error_deleting_collection' => __( 'Error on deleting collection.', 'tainacan' ), 'info_error_deleting_collection' => __( 'Error on deleting collection.', 'tainacan' ),
'info_error_deleting_category' => __( 'Error on deleting category', 'tainacan' ), 'info_error_deleting_category' => __( 'Error on deleting category', 'tainacan' ),
'info_collection_deleted' => __( 'Collection deleted.', 'tainacan' ), 'info_collection_deleted' => __( 'Collection deleted.', 'tainacan' ),
@ -181,6 +183,10 @@ return [
'info_warning_category_not_saved' => __('Are you sure? The category is not saved, changes will be lost.', 'tainacan'), 'info_warning_category_not_saved' => __('Are you sure? The category is not saved, changes will be lost.', 'tainacan'),
'info_warning_terms_not_saved' => __('Are you sure? There are terms not saved, changes will be lost.', 'tainacan'), 'info_warning_terms_not_saved' => __('Are you sure? There are terms not saved, changes will be lost.', 'tainacan'),
'info_warning_orphan_terms' => __('Are you sure? This term is parent of other terms. These will be converted to root terms.', 'tainacan'), 'info_warning_orphan_terms' => __('Are you sure? This term is parent of other terms. These will be converted to root terms.', 'tainacan'),
'info_there_is_no_field' => __('There is no field here.', 'tainacan' ),
'info_no_events' => __( 'No events', 'tainacan' ),
'info_logs_before' => __( 'Before updating', 'tainacan' ),
'info_logs_after' => __( 'What was updated', 'tainacan' ),
'info_there_is_no_field' => __('There is no field here yet.', 'tainacan' ), 'info_there_is_no_field' => __('There is no field here yet.', 'tainacan' ),
'info_there_is_no_filter' => __('There is no filter here yet.', 'tainacan' ), 'info_there_is_no_filter' => __('There is no filter here yet.', 'tainacan' ),

View File

@ -74,6 +74,9 @@ class TAINACAN_REST_Logs_Controller extends TAINACAN_REST_Controller {
$item_array['log_diff'] = $log_diff; $item_array['log_diff'] = $log_diff;
} }
unset($item_array['value']);
unset($item_array['old_value']);
return $item_array; return $item_array;
} }
@ -89,6 +92,7 @@ class TAINACAN_REST_Logs_Controller extends TAINACAN_REST_Controller {
* @param WP_REST_Request $request * @param WP_REST_Request $request
* *
* @return WP_Error|WP_REST_Response * @return WP_Error|WP_REST_Response
* @throws Exception
*/ */
public function get_items( $request ) { public function get_items( $request ) {
$args = $this->prepare_filters($request); $args = $this->prepare_filters($request);

View File

@ -28,6 +28,8 @@ class Collection extends Entity {
$default_view_mode, $default_view_mode,
$fields_order, $fields_order,
$filters_order, $filters_order,
$enable_cover_page,
$cover_page_id,
$moderators_ids; $moderators_ids;
/** /**
@ -35,7 +37,7 @@ class Collection extends Entity {
* @see \Tainacan\Entities\Entity::post_type * @see \Tainacan\Entities\Entity::post_type
* @var string * @var string
*/ */
protected static $post_type = 'tainacan-collection'; static $post_type = 'tainacan-collection';
/** /**
* {@inheritDoc} * {@inheritDoc}
* @see \Tainacan\Entities\Entity::repository * @see \Tainacan\Entities\Entity::repository
@ -335,6 +337,24 @@ class Collection extends Entity {
return $this->get_mapped_property( 'fields_order' ); return $this->get_mapped_property( 'fields_order' );
} }
/**
* Get enable cover page attribute
*
* @return string
*/
function get_enable_cover_page() {
return $this->get_mapped_property( 'enable_cover_page' );
}
/**
* Get enable cover page attribute
*
* @return string
*/
function get_cover_page_id() {
return $this->get_mapped_property( 'cover_page_id' );
}
/** /**
* Get collection filters ordination * Get collection filters ordination
* *
@ -507,6 +527,28 @@ class Collection extends Entity {
$this->set_mapped_property( 'filters_order', $value ); $this->set_mapped_property( 'filters_order', $value );
} }
/**
* Set enable cover page attribute
*
* @param [string] $value
*
* @return void
*/
function set_enable_cover_page( $value ) {
$this->set_mapped_property( 'enable_cover_page', $value );
}
/**
* Set cover page ID
*
* @param [string] $value
*
* @return void
*/
function set_cover_page_id( $value ) {
$this->set_mapped_property( 'cover_page_id', $value );
}
/** /**
* Set collection moderators ids * Set collection moderators ids
* *

View File

@ -28,7 +28,7 @@ class Field extends Entity {
public $enabled_for_collection = true; public $enabled_for_collection = true;
protected static $post_type = 'tainacan-field'; static $post_type = 'tainacan-field';
/** /**
* {@inheritDoc} * {@inheritDoc}
* @see \Tainacan\Entities\Entity::repository * @see \Tainacan\Entities\Entity::repository

View File

@ -19,7 +19,7 @@ class Filter extends Entity {
$filter_type, $filter_type,
$filter_type_options; $filter_type_options;
protected static $post_type = 'tainacan-filter'; static $post_type = 'tainacan-filter';
/** /**
* {@inheritDoc} * {@inheritDoc}

View File

@ -19,7 +19,7 @@ class Log extends Entity {
$log_date, $log_date,
$user_name; $user_name;
protected static $post_type = 'tainacan-log'; static $post_type = 'tainacan-log';
/** /**
* {@inheritDoc} * {@inheritDoc}
* @see \Tainacan\Entities\Entity::repository * @see \Tainacan\Entities\Entity::repository

View File

@ -21,7 +21,7 @@ class Taxonomy extends Entity {
* @see \Tainacan\Entities\Entity::post_type * @see \Tainacan\Entities\Entity::post_type
* @var string * @var string
*/ */
protected static $post_type = 'tainacan-taxonomy'; static $post_type = 'tainacan-taxonomy';
/** /**
* {@inheritDoc} * {@inheritDoc}
@ -37,6 +37,13 @@ class Taxonomy extends Entity {
*/ */
protected $repository = 'Taxonomies'; protected $repository = 'Taxonomies';
/**
* Prefix used to create the db_identifier
*
* @var string
*/
static $db_identifier_prefix = 'tnc_tax_';
public function __toString(){ public function __toString(){
return 'Hello, my name is '. $this->get_name(); return 'Hello, my name is '. $this->get_name();
} }
@ -138,7 +145,7 @@ class Taxonomy extends Entity {
* @return bool|string * @return bool|string
*/ */
function get_db_identifier() { function get_db_identifier() {
return $this->get_id() ? 'tnc_tax_' . $this->get_id() : false; return $this->get_id() ? self::$db_identifier_prefix . $this->get_id() : false;
} }
// Setters // Setters

View File

@ -17,7 +17,7 @@ class Term extends Entity {
$taxonomy; $taxonomy;
protected static $post_type = false; static $post_type = false;
/** /**
* {@inheritDoc} * {@inheritDoc}
* @see \Tainacan\Entities\Entity::repository * @see \Tainacan\Entities\Entity::repository

View File

@ -15,7 +15,7 @@
</template> </template>
<script> <script>
import { eventSearchBus } from '../../js/event-search-bus' import { eventBusSearch } from '../../js/event-bus-search'
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
export default { export default {
@ -33,7 +33,7 @@
computed: { computed: {
getErrorMessage() { getErrorMessage() {
let msg = ''; let msg = '';
let errors = eventSearchBus.getErrors( this.filter.id ); let errors = eventBusSearch.getErrors( this.filter.id );
if ( errors) { if ( errors) {
this.setFilterTypeMessage('is-danger'); this.setFilterTypeMessage('is-danger');
for (let index in errors) { for (let index in errors) {
@ -57,7 +57,7 @@
'getPostQuery' 'getPostQuery'
]), ]),
listen( event ){ listen( event ){
eventSearchBus.$emit( 'input', ( event.field_id ) ? event : event.detail[0] ); eventBusSearch.$emit( 'input', ( event.field_id ) ? event : event.detail[0] );
}, },
setFilterTypeMessage( message ){ setFilterTypeMessage( message ){
this.filterTypeMessage = message; this.filterTypeMessage = message;

View File

@ -149,6 +149,24 @@ class Collections extends Repository {
'description' => __( 'Collection filters ordination', 'tainacan' ), 'description' => __( 'Collection filters ordination', 'tainacan' ),
//'validation' => v::stringType(), //'validation' => v::stringType(),
], ],
'enable_cover_page' => [
'map' => 'meta',
'title' => __('Enable Cover Page', 'tainacan'),
'type' => 'string',
'description'=> __('Use page as the home page of this collection', 'tainacan'),
'on_error' => __('Value should be yes or no', 'tainacan'),
'validation' => v::stringType()->in(['yes', 'no']), // yes or no
'default' => 'no'
],
'cover_page_id' => [
'map' => 'meta',
'title' => __('Cover Page ID', 'tainacan'),
'type' => 'string',
'description'=> __('The page to be used as cover for this collection', 'tainacan'),
'on_error' => __('Invalid page', 'tainacan'),
//'validation' => v::numeric(),
'default' => ''
],
'moderators_ids' => [ 'moderators_ids' => [
'map' => 'meta_multi', 'map' => 'meta_multi',
'title' => __( 'Moderators', 'tainacan' ), 'title' => __( 'Moderators', 'tainacan' ),

View File

@ -22,10 +22,8 @@ class Fields extends Repository {
private static $instance = null; private static $instance = null;
public static function get_instance() public static function get_instance() {
{ if(!isset(self::$instance)) {
if(!isset(self::$instance))
{
self::$instance = new self(); self::$instance = new self();
} }
@ -640,6 +638,7 @@ class Fields extends Repository {
* @param $field_id * @param $field_id
* *
* @return array|null|object * @return array|null|object
* @throws \Exception
*/ */
public function fetch_all_field_values($collection_id, $field_id){ public function fetch_all_field_values($collection_id, $field_id){
global $wpdb; global $wpdb;
@ -767,7 +766,8 @@ class Fields extends Repository {
* a field type category is inserted or removed * a field type category is inserted or removed
* *
* @param [type] $field [description] * @param [type] $field [description]
* @return [type] [description] *
* @return void [type] [description]
*/ */
private function update_category_field($field) { private function update_category_field($field) {
$field_type = $field->get_field_type_object(); $field_type = $field->get_field_type_object();

View File

@ -210,14 +210,14 @@ class Logs extends Repository {
public function fetch_last() { public function fetch_last() {
$args = [ $args = [
'post_type' => Entities\Log::get_post_type(), 'post_type' => Entities\Log::get_post_type(),
'posts_per_page' => -1, 'posts_per_page' => 1,
'orderby' => 'date', 'orderby' => 'ID',
'order' => 'DESC' 'order' => 'DESC'
]; ];
$logs = $this->fetch( $args, 'OBJECT' ); $logs = $this->fetch( $args, 'OBJECT' );
return array_pop( $logs ); return array_pop($logs);
} }
/** /**
@ -226,6 +226,8 @@ class Logs extends Repository {
* @param Entity $new_value * @param Entity $new_value
* @param Entity $old_value * @param Entity $old_value
* *
* @param null $is_update
*
* @return Entities\Log new created log * @return Entities\Log new created log
*/ */
public function log_inserts( $new_value, $old_value = null, $is_update = null ) { public function log_inserts( $new_value, $old_value = null, $is_update = null ) {
@ -234,7 +236,17 @@ class Logs extends Repository {
if ( is_object( $new_value ) ) { if ( is_object( $new_value ) ) {
// do not log a log // do not log a log
if ( method_exists( $new_value, 'get_post_type' ) && $new_value->get_post_type() == 'tainacan-log' ) { if ( method_exists( $new_value, 'get_post_type' ) && $new_value->get_post_type() == 'tainacan-log' || $new_value->get_status() === 'auto-draft' ) {
return;
}
if($new_value instanceof Entities\Field){
$type = $new_value->get_field_type();
if($type === 'Tainacan\Field_Types\Core_Title' || $type === 'Tainacan\Field_Types\Core_Description'){
return;
}
} elseif (!$is_update && $new_value instanceof Entities\Item || $new_value instanceof Entities\Collection) {
return; return;
} }
@ -244,6 +256,10 @@ class Logs extends Repository {
$name = method_exists($new_value, 'get_name') ? $new_value->get_name() : $name = method_exists($new_value, 'get_name') ? $new_value->get_name() :
(method_exists($new_value, 'get_title') ? $new_value->get_title() : $new_value->get_field()->get_name()); (method_exists($new_value, 'get_title') ? $new_value->get_title() : $new_value->get_field()->get_name());
if(!$name){
$name = $new_value->get_status();
}
$articleA = 'A'; $articleA = 'A';
$articleAn = 'An'; $articleAn = 'An';
$vowels = 'aeiou'; $vowels = 'aeiou';
@ -251,19 +267,32 @@ class Logs extends Repository {
if($is_update){ if($is_update){
if(substr_count($vowels, strtolower(substr($class_name, 0, 1))) > 0){ if(substr_count($vowels, strtolower(substr($class_name, 0, 1))) > 0){
$msn = sprintf( __( '%s %s has been updated.', 'tainacan' ), $articleAn, $class_name); $msn = sprintf( __( '%s %s has been updated.', 'tainacan' ), $articleAn, $class_name);
$description = sprintf( __("The \"%s\" %s has been updated.", 'tainacan' ), $name, strtolower($class_name));
} else { } else {
$msn = sprintf( __( '%s %s has been updated.', 'tainacan' ), $articleA, $class_name); $msn = sprintf( __( '%s %s has been updated.', 'tainacan' ), $articleA, $class_name);
$description = sprintf( __("The \"%s\" %s has been updated.", 'tainacan' ), $name, strtolower($class_name));
} }
$description = sprintf( __("The \"%s\" %s has been updated.", 'tainacan' ), $name, strtolower($class_name));
} else { } else {
if(substr_count($vowels, strtolower(substr($class_name, 0, 1))) > 0){ if(substr_count($vowels, strtolower(substr($class_name, 0, 1))) > 0){
$msn = sprintf( __( '%s %s has been created.', 'tainacan' ), $articleAn, $class_name); $msn = sprintf( __( '%s %s has been created.', 'tainacan' ), $articleAn, $class_name);
$description = sprintf( __("The \"%s\" %s has been created.", 'tainacan' ), $name, strtolower($class_name));
} else { } else {
$msn = sprintf( __( '%s %s has been created.', 'tainacan' ), $articleA, $class_name); $msn = sprintf( __( '%s %s has been created.', 'tainacan' ), $articleA, $class_name);
$description = sprintf( __("The \"%s\" %s has been created.", 'tainacan' ), $name, strtolower($class_name)); }
if($new_value instanceof Entities\Field){
$collection = $new_value->get_collection();
$parent = $collection;
if($collection) {
$parent = $collection->get_name();
if ( ! $parent ) {
$parent = $collection->get_status();
}
}
$description = sprintf( __( "The \"%s\" %s has been created on %s.", 'tainacan' ), $name, strtolower( $class_name ), $parent );
} else {
$description = sprintf( __( "The \"%s\" %s has been created.", 'tainacan' ), $name, strtolower( $class_name ) );
} }
} }
} }

View File

@ -341,12 +341,12 @@ abstract class Repository {
* *
* @return array[] * @return array[]
*/ */
public static function get_collections_db_identifier() { public static function get_collections_db_identifiers() {
$Tainacan_Collections = \Tainacan\Repositories\Collections::get_instance(); $Tainacan_Collections = \Tainacan\Repositories\Collections::get_instance();
$collections = $Tainacan_Collections->fetch( [], 'OBJECT' ); $collections = $Tainacan_Collections->fetch( [], 'OBJECT' );
$cpts = []; $cpts = [];
foreach ( $collections as $col ) { foreach ( $collections as $col ) {
$cpts[ $col->get_db_identifier() ] = $col; $cpts[] = $col->get_db_identifier();
} }
return $cpts; return $cpts;
@ -387,8 +387,8 @@ abstract class Repository {
// Is it a collection Item? // Is it a collection Item?
if ( $prefix == Entities\Collection::$db_identifier_prefix ) { if ( $prefix == Entities\Collection::$db_identifier_prefix ) {
$cpts = self::get_collections_db_identifier(); $cpts = self::get_collections_db_identifiers();
if ( array_key_exists( $post_type, $cpts ) ) { if ( in_array( $post_type, $cpts ) ) {
return $entity = new \Tainacan\Entities\Item( $post ); return $entity = new \Tainacan\Entities\Item( $post );
} else { } else {
throw new \Exception( 'Collection object not found for this post' ); throw new \Exception( 'Collection object not found for this post' );
@ -637,7 +637,7 @@ abstract class Repository {
foreach ( $map as $prop => $mapped ) { foreach ( $map as $prop => $mapped ) {
if ( $old_entity->get_mapped_property( $prop ) != $new_entity->get_mapped_property( $prop ) ) { if ( $old_entity->get_mapped_property( $prop ) != $new_entity->get_mapped_property( $prop ) ) {
if ( $mapped['map'] == 'meta_multi' ) { if ( $mapped['map'] == 'meta_multi' || is_array($new_entity->get_mapped_property( $prop ))) {
// Array of diffs with index of diff in new array // Array of diffs with index of diff in new array
$array_diff_with_index = array_diff_assoc($new_entity->get_mapped_property( $prop ), $old_entity->get_mapped_property( $prop )); $array_diff_with_index = array_diff_assoc($new_entity->get_mapped_property( $prop ), $old_entity->get_mapped_property( $prop ));
@ -650,7 +650,7 @@ abstract class Repository {
'diff_with_index' => $array_diff_with_index, 'diff_with_index' => $array_diff_with_index,
]; ];
} }
} else { } elseif($mapped['map'] !== 'post_modified') {
$new_as_array = explode(' ', $new_entity->get_mapped_property( $prop )); $new_as_array = explode(' ', $new_entity->get_mapped_property( $prop ));
$old_as_array = explode(' ', $old_entity->get_mapped_property( $prop )); $old_as_array = explode(' ', $old_entity->get_mapped_property( $prop ));

View File

@ -2,7 +2,7 @@ import Vue from 'vue';
import store from './store/store' import store from './store/store'
import router from './../admin/js/router.js'; import router from './../admin/js/router.js';
export const eventSearchBus = new Vue({ export const eventBusSearch = new Vue({
router, router,
store, store,
data: { data: {
@ -80,13 +80,13 @@ export const eventSearchBus = new Vue({
}, },
loadItems() { loadItems() {
this.$emit( 'isLoadingItems', true); this.$emit( 'isLoadingItems', true);
store.dispatch('collection/fetchItems', this.$route.params.collectionId).then(() => { store.dispatch('collection/fetchItems', this.$route.params.collectionId).then((res) => {
this.$emit( 'isLoadingItems', false); this.$emit( 'isLoadingItems', false);
this.$emit( 'hasFiltered', res.hasFiltered);
}) })
.catch(() => { .catch(() => {
this.$emit( 'isLoadingItems', false); this.$emit( 'isLoadingItems', false);
}); });
}, },
/* Dev interfaces methods */ /* Dev interfaces methods */

View File

@ -4,7 +4,7 @@ import Buefy from 'buefy'
// include vue-custom-element plugin to Vue // include vue-custom-element plugin to Vue
import VueCustomElement from 'vue-custom-element'; import VueCustomElement from 'vue-custom-element';
import { eventBus } from './event-bus-web-components'; import { eventBus } from './event-bus-web-components';
import { eventSearchBus } from './event-search-bus'; import { eventBusSearch } from './event-bus-search';
Vue.use(Buefy); Vue.use(Buefy);
@ -53,19 +53,19 @@ eventBus.registerComponent( 'tainacan-form-relationship' );
/* Filters */ /* Filters */
Vue.customElement('tainacan-filter-custom-interval', FilterCustomInterval); Vue.customElement('tainacan-filter-custom-interval', FilterCustomInterval);
eventSearchBus.registerComponent( 'tainacan-filter-custom-interval' ); eventBusSearch.registerComponent( 'tainacan-filter-custom-interval' );
Vue.customElement('tainacan-filter-selectbox', FilterSelectbox); Vue.customElement('tainacan-filter-selectbox', FilterSelectbox);
eventSearchBus.registerComponent( 'tainacan-filter-selectbox' ); eventBusSearch.registerComponent( 'tainacan-filter-selectbox' );
Vue.customElement('tainacan-filter-autocomplete', FilterAutocomplete); Vue.customElement('tainacan-filter-autocomplete', FilterAutocomplete);
eventSearchBus.registerComponent( 'tainacan-filter-autocomplete' ); eventBusSearch.registerComponent( 'tainacan-filter-autocomplete' );
Vue.customElement('tainacan-filter-checkbox', FilterCheckbox); Vue.customElement('tainacan-filter-checkbox', FilterCheckbox);
eventSearchBus.registerComponent( 'tainacan-filter-checkbox' ); eventBusSearch.registerComponent( 'tainacan-filter-checkbox' );
Vue.customElement('tainacan-filter-taginput', FilterTaginput); Vue.customElement('tainacan-filter-taginput', FilterTaginput);
eventSearchBus.registerComponent( 'tainacan-filter-taginput' ); eventBusSearch.registerComponent( 'tainacan-filter-taginput' );
eventSearchBus.listener(); eventBusSearch.listener();

View File

@ -2,8 +2,18 @@ import axios from '../../../axios/axios';
import qs from 'qs'; import qs from 'qs';
export const fetchItems = ({ rootGetters, dispatch, commit }, collectionId) => { export const fetchItems = ({ rootGetters, dispatch, commit }, collectionId) => {
commit('cleanItems');
return new Promise ((resolve, reject) => { return new Promise ((resolve, reject) => {
// Adds queries for filtering
let postQueries = rootGetters['search/getPostQuery']; let postQueries = rootGetters['search/getPostQuery'];
// Sets a flag to inform components that an empty sate is or not due to filtering
let hasFiltered = false;
if (postQueries.metaquery != undefined && postQueries.metaquery.length > 0)
hasFiltered = true;
// Differentiates between repository level and collection level queries
let endpoint = '/collection/'+collectionId+'/items?' let endpoint = '/collection/'+collectionId+'/items?'
if (collectionId == undefined) if (collectionId == undefined)
endpoint = '/items?' endpoint = '/items?'
@ -13,7 +23,7 @@ export const fetchItems = ({ rootGetters, dispatch, commit }, collectionId) => {
let items = res.data; let items = res.data;
commit('setItems', items ); commit('setItems', items );
dispatch('search/setTotalItems', res.headers['x-wp-total'], { root: true } ); dispatch('search/setTotalItems', res.headers['x-wp-total'], { root: true } );
resolve({'items': items, 'total': res.headers['x-wp-total'] }); resolve({'items': items, 'total': res.headers['x-wp-total'], hasFiltered: hasFiltered});
}) })
.catch(error => reject(error)); .catch(error => reject(error));
}); });
@ -33,6 +43,7 @@ export const deleteItem = ({ commit }, item_id ) => {
}; };
export const fetchCollections = ({commit} , { page, collectionsPerPage }) => { export const fetchCollections = ({commit} , { page, collectionsPerPage }) => {
commit('cleanCollections');
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.tainacan.get('/collections?paged='+page+'&perpage='+collectionsPerPage) axios.tainacan.get('/collections?paged='+page+'&perpage='+collectionsPerPage)
.then(res => { .then(res => {
@ -48,6 +59,7 @@ export const fetchCollections = ({commit} , { page, collectionsPerPage }) => {
} }
export const fetchCollection = ({ commit }, id) => { export const fetchCollection = ({ commit }, id) => {
commit('cleanCollection');
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) =>{
axios.tainacan.get('/collections/' + id) axios.tainacan.get('/collections/' + id)
.then(res => { .then(res => {
@ -62,6 +74,7 @@ export const fetchCollection = ({ commit }, id) => {
} }
export const fetchCollectionName = ({ commit }, id) => { export const fetchCollectionName = ({ commit }, id) => {
commit('cleanCollectionName');
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) =>{
axios.tainacan.get('/collections/' + id + '?fetch_only=name') axios.tainacan.get('/collections/' + id + '?fetch_only=name')
.then(res => { .then(res => {
@ -149,6 +162,7 @@ export const sendAttachment = ( { commit }, { collection_id, file }) => {
}; };
export const fetchAttachments = ({ commit }, collection_id) => { export const fetchAttachments = ({ commit }, collection_id) => {
commit('cleanAttachments')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.wp.get('/media/?post=' + collection_id) axios.wp.get('/media/?post=' + collection_id)
.then(res => { .then(res => {

View File

@ -4,6 +4,9 @@ export const setItems = ( state, items ) => {
state.items = items; state.items = items;
} }
export const cleanItems = (state) => {
state.items = [];
}
export const deleteItem = ( state, item ) => { export const deleteItem = ( state, item ) => {
let index = state.items.findIndex(deletedItem => deletedItem.id === item.id); let index = state.items.findIndex(deletedItem => deletedItem.id === item.id);
@ -23,18 +26,26 @@ export const setCollections = (state, collections) => {
state.collections = collections; state.collections = collections;
} }
export const setFields = (state, fields) => { export const cleanCollections = (state) => {
state.fields = fields; state.collections = [];
} }
export const setCollection = (state, collection) => { export const setCollection = (state, collection) => {
state.collection = collection; state.collection = collection;
} }
export const cleanCollection = (state) => {
state.collection = [];
}
export const setCollectionName = (state, collectionName) => { export const setCollectionName = (state, collectionName) => {
state.collectionName = collectionName; state.collectionName = collectionName;
} }
export const cleanCollectionName = (state) => {
state.collectionName = '';
}
export const setSingleAttachment = ( state, attachment ) => { export const setSingleAttachment = ( state, attachment ) => {
let index = state.attachments.findIndex(newAttachment => newAttachment.id === attachment.id); let index = state.attachments.findIndex(newAttachment => newAttachment.id === attachment.id);
if ( index >= 0){ if ( index >= 0){
@ -48,3 +59,7 @@ export const setSingleAttachment = ( state, attachment ) => {
export const setAttachments = ( state, attachments ) => { export const setAttachments = ( state, attachments ) => {
state.attachments = attachments; state.attachments = attachments;
} }
export const cleanAttachments = (state) => {
state.attachments = [];
}

View File

@ -3,7 +3,7 @@ import axios from '../../../axios/axios'
export const fetchEvents = ({ commit }, { page, eventsPerPage } ) => { export const fetchEvents = ({ commit }, { page, eventsPerPage } ) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.tainacan.get(`/logs?paged=${page}&perpage=${eventsPerPage}`) axios.tainacan.get(`/logs?paged=${page}&perpage=${eventsPerPage}&context=edit`)
.then(res => { .then(res => {
let events = res.data; let events = res.data;
@ -49,7 +49,15 @@ export const fetchEventTitle = ({ commit }, eventId) => {
}; };
export const approve = ({commit}, eventId) => { export const approve = ({commit}, eventId) => {
return new Promise((resolve, reject) => {
axios.tainacan.get(`/logs/${eventId}/approve`)
.then(res => {
let event = res.data;
this.$console.log(event);
})
.catch(error => reject(error))
});
}; };
export const notApprove = ({commit}, eventId) => { export const notApprove = ({commit}, eventId) => {

View File

@ -34,6 +34,7 @@ export const updateMetadata = ({ commit }, { item_id, field_id, values }) => {
}; };
export const fetchFields = ({ commit }, item_id) => { export const fetchFields = ({ commit }, item_id) => {
commit('cleanFields');
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.tainacan.get('/item/'+item_id+'/metadata') axios.tainacan.get('/item/'+item_id+'/metadata')
.then(res => { .then(res => {
@ -53,6 +54,7 @@ export const cleanFields = ({ commit }) => {
// Actions directly related to Item // Actions directly related to Item
export const fetchItem = ({ commit }, item_id) => { export const fetchItem = ({ commit }, item_id) => {
commit('cleanItem')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.tainacan.get('/items/'+item_id) axios.tainacan.get('/items/'+item_id)
.then(res => { .then(res => {
@ -67,6 +69,7 @@ export const fetchItem = ({ commit }, item_id) => {
}; };
export const fetchItemTitle = ({ commit }, id) => { export const fetchItemTitle = ({ commit }, id) => {
commit('cleanItemTitle');
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) =>{
axios.tainacan.get('/items/' + id + '?fetch_only=title') axios.tainacan.get('/items/' + id + '?fetch_only=title')
.then(res => { .then(res => {
@ -111,6 +114,7 @@ export const updateItem = ({ commit }, { item_id, status }) => {
// Attachments ======================================= // Attachments =======================================
export const sendAttachment = ( { commit }, { item_id, file }) => { export const sendAttachment = ( { commit }, { item_id, file }) => {
commit('cleanAttachment');
return new Promise(( resolve, reject ) => { return new Promise(( resolve, reject ) => {
axios.wp.post('/media/?post=' + item_id, file, { axios.wp.post('/media/?post=' + item_id, file, {
headers: { 'Content-Disposition': 'attachment; filename=' + file.name }, headers: { 'Content-Disposition': 'attachment; filename=' + file.name },
@ -130,6 +134,7 @@ export const sendAttachment = ( { commit }, { item_id, file }) => {
}; };
export const fetchAttachments = ({ commit }, item_id) => { export const fetchAttachments = ({ commit }, item_id) => {
commit('cleanAttachments');
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.wp.get('/media/?post=' + item_id) axios.wp.get('/media/?post=' + item_id)
.then(res => { .then(res => {

View File

@ -4,6 +4,10 @@ export const setItem = ( state, item ) => {
state.item = item; state.item = item;
} }
export const cleanItem = ( state ) => {
state.item = [];
}
export const setSingleAttachment = ( state, attachment ) => { export const setSingleAttachment = ( state, attachment ) => {
let index = state.attachments.findIndex(newAttachment => newAttachment.id === attachment.id); let index = state.attachments.findIndex(newAttachment => newAttachment.id === attachment.id);
if ( index >= 0){ if ( index >= 0){
@ -18,10 +22,22 @@ export const setAttachments = ( state, attachments ) => {
state.attachments = attachments; state.attachments = attachments;
} }
export const cleanAttachment = (state) => {
state.attachment = {};
}
export const cleanAttachments = (state) => {
state.attachments = [];
}
export const setItemTitle = ( state, itemTitle ) => { export const setItemTitle = ( state, itemTitle ) => {
state.itemTitle = itemTitle; state.itemTitle = itemTitle;
} }
export const cleanItemTitle = ( state ) => {
state.itemTitle = '';
}
export const setFields = ( state, fields) => { export const setFields = ( state, fields) => {
state.fields = fields; state.fields = fields;
} }

View File

@ -35,8 +35,11 @@ export const setItemsPerPage = ({ commit }, page ) => {
// Sorting queries // Sorting queries
export const setOrderBy = ({ commit }, orderBy ) => { export const setOrderBy = ({ commit }, orderBy ) => {
// Primitive Types: string, date, item, term, compound, float // Primitive Types: string, date, item, term, compound, float
if (orderBy.field_type_object.primitive_type == 'float' || orderBy.field_type_object.primitive_type == 'int') { if (orderBy.id == 'date') {
commit('setPostQueryAttribute', { attr: 'orderby', value: 'date' } );
} else if (orderBy.field_type_object.primitive_type == 'float' || orderBy.field_type_object.primitive_type == 'int') {
commit('setPostQueryAttribute', { attr: 'meta_key', value: orderBy.id } ); commit('setPostQueryAttribute', { attr: 'meta_key', value: orderBy.id } );
commit('setPostQueryAttribute', { attr: 'orderby', value: 'meta_value_num' } ); commit('setPostQueryAttribute', { attr: 'orderby', value: 'meta_value_num' } );
} else if (orderBy.field_type_object.primitive_type == 'date') { } else if (orderBy.field_type_object.primitive_type == 'date') {

View File

@ -21,6 +21,17 @@ class Theme_Helper {
add_filter( 'the_content', [&$this, 'the_content_filter'] ); add_filter( 'the_content', [&$this, 'the_content_filter'] );
/**
* Replace collections permalink to post type archive if cover not enabled
* TODO: Replace single query (via pre_get_post) to post type archvive
* TODO: Replace single query to the page content set as cover for the colllection
*/
add_filter('post_type_link', array(&$this, 'permalink_filter'), 10, 3);
// TODO: Not working yet
//add_action('pre_get_posts', array(&$this, 'collection_single_pre_get_posts'));
// make archive for terms work with items
add_action('pre_get_posts', array(&$this, 'tax_archive_pre_get_posts'));
} }
@ -30,6 +41,15 @@ class Theme_Helper {
return $prefix == Entities\Collection::$db_identifier_prefix; return $prefix == Entities\Collection::$db_identifier_prefix;
} }
public function is_taxonomy_a_tainacan_tax($tax_slug) {
$prefix = substr( $tax_slug, 0, strlen( Entities\Taxonomy::$db_identifier_prefix ) );
return $prefix == Entities\Taxonomy::$db_identifier_prefix;
}
public function is_term_a_tainacan_term( \WP_Term $term ) {
return $this->is_taxonomy_a_tainacan_tax($term->taxonomy);
}
public function the_content_filter($content) { public function the_content_filter($content) {
global $post; global $post;
@ -55,6 +75,70 @@ class Theme_Helper {
} }
/**
* Filters the permalink for posts to:
*
* * Replace Collectino single permalink with the link to the post type archive for items of that collection
*
* @return string new permalink
*/
function permalink_filter($permalink, $post, $leavename) {
$collection_post_type = \Tainacan\Entities\Collection::get_post_type();
if (!is_admin() && $post->post_type == $collection_post_type) {
$collection = new \Tainacan\Entities\Collection($post);
if ($collection->get_enable_cover_page() == 'yes') {
return $permalink;
}
$items_post_type = $collection->get_db_identifier();
$post_type_object = get_post_type_object($items_post_type);
if (isset($post_type_object->rewrite) && is_array($post_type_object->rewrite) && isset($post_type_object->rewrite['slug']))
return site_url($post_type_object->rewrite['slug']);
}
return $permalink;
}
function tax_archive_pre_get_posts($wp_query) {
if (!$wp_query->is_tax() || !$wp_query->is_main_query())
return $wp_query;
$term = get_queried_object();
if ($this->is_term_a_tainacan_term($term)) {
// TODO: Why post_type = any does not work?
$wp_query->set( 'post_type', \Tainacan\Repositories\Repository::get_collections_db_identifiers() );
}
return $wp_query;
}
// TODO: Not working yet
function collection_single_pre_get_posts($wp_query) {
if (!$wp_query->is_single() || !$wp_query->is_main_query())
return $wp_query;
if ($wp_query->get('post_type') == \Tainacan\Entities\Collection::$post_type) {
$wp_query->set('query', [
'post_type' => \Tainacan\Entities\Collection::$post_type
]);
}
return $wp_query;
}
} }

View File

@ -306,11 +306,11 @@ class Collections extends TAINACAN_UnitTestCase {
$diff = $x->diff(); $diff = $x->diff();
$this->assertEquals(3, count($diff)); $this->assertEquals(3, count($diff));
$this->assertEquals($diff['name']['new'], 'OtherValue'); $this->assertEquals($diff['name']['new'][0], 'OtherValue');
$this->assertEquals($diff['name']['old'], 'testeDiff'); $this->assertEquals($diff['name']['old'], 'testeDiff');
$this->assertEquals($diff['description']['new'], 'testeDiff2'); $this->assertEquals($diff['description']['new'][0], 'testeDiff2');
$this->assertEquals($diff['description']['old'], 'adasdasdsa'); $this->assertEquals($diff['description']['old'], 'adasdasdsa');
$this->assertEquals([1 => 4, 2 => 5], $diff['moderators_ids']['diff']); $this->assertEquals([1 => 4, 2 => 5, 0 => 3], $diff['moderators_ids']['diff_with_index']);
} }
} }