Skip to content
This repository was archived by the owner on Feb 18, 2021. It is now read-only.

Fix WooCommerce on WP.com specs #1055

Merged
merged 1 commit into from
Mar 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/components/store-sidebar-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class StoreSidebarComponent extends BaseContainer {
// this is necessary on mobile width screens
displayComponentIfNecessary() {
const driver = this.driver;
const mobileLeftArrowSelector = By.css( '.current-section a' );
const mobileLeftArrowSelector = By.css( '.action-header button' );
driver.findElement( mobileLeftArrowSelector ).isDisplayed().then( ( displayed ) => {
if ( displayed === true ) {
driverHelper.clickWhenClickable( driver, mobileLeftArrowSelector );
Expand Down
10 changes: 8 additions & 2 deletions lib/pages/woocommerce/add-edit-product-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import config from 'config';
import BaseContainer from '../../base-container';

import * as driverHelper from '../../driver-helper';
import * as driverManager from '../../driver-manager';
import * as dataHelper from '../../data-helper';

export default class AddEditProductPage extends BaseContainer {
Expand Down Expand Up @@ -65,8 +66,13 @@ export default class AddEditProductPage extends BaseContainer {
}

deleteProduct() {
driverHelper.clickWhenClickable( this.driver, by.css( '.action-header__actions button.is-scary' ) );
if ( driverManager.currentScreenSize() === 'mobile' ) {
// open the menu on mobile screens
driverHelper.clickWhenClickable( this.driver, by.css( 'button.split-button__toggle' ) );
driverHelper.clickWhenClickable( this.driver, by.css( '.popover__menu-item.is-scary' ) );
} else {
driverHelper.clickWhenClickable( this.driver, by.css( '.action-header__actions button.is-scary' ) );
}
driverHelper.clickWhenClickable( this.driver, by.css( '.dialog__action-buttons button[data-e2e-button="accept"]' ) );
}

}
4 changes: 2 additions & 2 deletions specs-woocommerce/wp-woocommerce-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ test.describe( `Can see WooCommerce Store option in Calypso '${ screenSize }' @p
this.navBarComponent.clickMySites();
} );

test.it( 'Can see \'Store (BETA)\' option in main Calypso menu for an AT WooCommerce site set to the US', function() {
test.it( 'Can see \'Store\' option in main Calypso menu for an AT WooCommerce site set to the US', function() {
this.sideBarComponent = new SidebarComponent( driver );
this.sideBarComponent.storeOptionDisplayed().then( ( displayed ) => {
assert( displayed, 'The Store menu option is not displayed for the AT WooCommerce site set to the US' );
} );
} );

test.it( 'The \'Store (BETA)\' option opens the store dashboard with its own sidebar', function() {
test.it( 'The \'Store\' option opens the store dashboard with its own sidebar', function() {
this.sideBarComponent = new SidebarComponent( driver );
this.sideBarComponent.selectStoreOption();
this.storeDashboardPage = new StoreDashboardPage( driver );
Expand Down