Skip to content

Commit

Permalink
fix load-wp tests & spread them out
Browse files Browse the repository at this point in the history
  • Loading branch information
hansmorb committed Sep 11, 2023
1 parent 5d4794b commit 2e0aeae
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions cypress/e2e/load-wp.cy.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe( 'Run a pull', function() {
describe( 'Visit backend sites', function() {
// Go to WordPress login page and login.
beforeEach( function() {
cy.visit( '/wp-login.php' );
cy.wait( 1000 );
cy.get( '#user_login' ).type( Cypress.env( "wpUser" ) );
cy.get( '#user_login' ).type( Cypress.env( "wpAdmin" ) );
cy.get( '#user_pass' ).type( Cypress.env( "wpPassword" ) );
cy.get( '#wp-submit' ).click();
} );
Expand All @@ -19,55 +19,63 @@ describe( 'Run a pull', function() {
cy.screenshot( 'wp-admin-dashboard' )
} );

it ('can load the CB pages', function() {
it ('can load the CB dashboard', function() {
cy.visit( '/wp-admin/admin.php?page=cb-dashboard' );
cy.contains("Welcome to CommonsBooking.");
cy.screenshot( 'wp-admin-cb-dashboard' )
} );

//Timeframes menu page
it ('can load the timeframes menu page', function() {
cy.visit( '/wp-admin/edit.php?post_type=cb_timeframe' );
cy.contains("Timeframes");
cy.screenshot( 'wp-admin-cb-timeframes' )
} );

//Items menu page
it ('can load the items menu page', function() {
cy.visit( '/wp-admin/edit.php?post_type=cb_item' );
cy.contains("Items");
cy.screenshot( 'wp-admin-cb-items' )
} );

//Locations menu page
it ('can load the locations menu page', function() {
cy.visit( '/wp-admin/edit.php?post_type=cb_location' );
cy.contains("Locations");
cy.screenshot( 'wp-admin-cb-locations' )
} );

//Bookings menu page
it ('can load the bookings menu page', function() {
cy.visit( '/wp-admin/edit.php?post_type=cb_booking' );
cy.contains("Bookings");
cy.screenshot( 'wp-admin-cb-bookings' )
} );

//Maps menu page
it ('can load the maps menu page', function() {
cy.visit( '/wp-admin/edit.php?post_type=cb_map' );
cy.contains("Maps");
cy.screenshot( 'wp-admin-cb-maps' )
} );

//Restrictions menu page
it ('can load the restrictions menu page', function() {
cy.visit( '/wp-admin/edit.php?post_type=cb_restriction' );
cy.contains("Restrictions");
cy.screenshot( 'wp-admin-cb-restrictions' )
} );

//Item Categories menu page
it ('can load the item categories menu page', function() {
cy.visit( '/wp-admin/edit-tags.php?taxonomy=cb_items_category' );
cy.contains("Item Category");
cy.screenshot( 'wp-admin-cb-item-categories' )
} );

//Location Categories menu page
it ('can load the location categories menu page', function() {
cy.visit( '/wp-admin/edit-tags.php?taxonomy=cb_locations_category' );
cy.contains("Location Category");
cy.screenshot( 'wp-admin-cb-location-categories' )
} );

//Settings page
it ('can load the settings menu page', function() {
cy.visit( '/wp-admin/options-general.php?page=commonsbooking_options' );
cy.contains("Welcome to CommonsBooking");
cy.screenshot( 'wp-admin-cb-settings' )

} );
});

0 comments on commit 2e0aeae

Please sign in to comment.