forked from wielebenwir/commonsbooking
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test data & basic shortcode tests
- Loading branch information
Showing
7 changed files
with
453 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# setup-cypress-env.sh | ||
# Felipe Elia <contato@felipeelia.com.br> and 10up contributors | ||
# | ||
# The following code is a derivative work of the code from the ElasticPress project, | ||
# which is licensed GPLv2. This code therefore is also licensed under the terms | ||
# of the GNU Public License, version 2.' | ||
|
||
#!/bin/bash | ||
|
||
./bin/wp-env-cli tests-wordpress "wp --allow-root import /var/www/html/wp-content/plugins/commonsbooking/cypress/wordpress-files/content-example.xml --authors=create" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
describe('load shortcodes', () => { | ||
it('can load cb_items shortcode', () => { | ||
cy.visit('/?page_id=13') | ||
cy.get('.cb-shortcode-items').should('be.visible') | ||
cy.screenshot('cb-items-shortcode') | ||
cy.get('.cb-shortcode-items').find('.cb-button').should('be.visible') | ||
cy.get('.cb-shortcode-items').find('.cb-button').contains('Book item') | ||
cy.get('.cb-shortcode-items').find('.cb-button').click() | ||
cy.url().should('include', '/?cb_item=basictest-noadmin&cb-location=32') | ||
}) | ||
it('can load cb_locations shortcode', () => { | ||
cy.visit('/?page_id=15') | ||
cy.get('.cb-shortcode-locations').should('be.visible') | ||
cy.screenshot('cb-locations-shortcode') | ||
cy.get('.cb-shortcode-locations').find('.cb-button').should('be.visible') | ||
cy.get('.cb-shortcode-locations').find('.cb-button').contains('Book item') | ||
cy.get('.cb-shortcode-locations').find('.cb-button').click() | ||
cy.url().should('include', '/?cb_item=basictest-noadmin&cb-location=32') | ||
} ) | ||
|
||
it('can load cb_item_table shortcode', () => { | ||
cy.visit('/?page_id=17') | ||
cy.get('.cb-shortcode-items_table').should('be.visible') | ||
cy.screenshot('cb-item-table-shortcode') | ||
cy.get('.cb-shortcode-items_table').find('tbody > tr > :nth-child(1)').contains('BasicTest') | ||
cy.get('.cb-shortcode-items_table').find('tbody > tr > :nth-child(1)').find('b > a').should('be.visible') | ||
cy.get('.cb-shortcode-items_table').find('tbody > tr > :nth-child(1)').find('b > a').click() | ||
cy.url().should('include', '/?cb_item=basictest-noadmin&cb-location=32') | ||
} ) | ||
}) |
Oops, something went wrong.