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

Commit

Permalink
Jetpack: Adds a check that related posts are shown in the customizer (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alisterscott committed Dec 21, 2016
1 parent 155ca56 commit 7721500
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
23 changes: 23 additions & 0 deletions lib/pages/wp-admin/wp-admin-customizer-page.js
@@ -0,0 +1,23 @@
import { By as by, until } from 'selenium-webdriver';
import BaseContainer from '../../base-container';

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

export default class WpAdminCustomizerPage extends BaseContainer {
constructor( driver ) {
const expectedElementSelector = by.css( '.wp-customizer' );
super( driver, expectedElementSelector );
}

relatedPostsSectionShown() {
let present = false;

present = this.driver.wait( until.elementLocated( by.css( '#sub-accordion-section-jetpack_relatedposts' ) ), this.explicitWaitMS ).then( () => {
return true;
}, ( ) => {
return false;
} );
return present;
}
}
7 changes: 6 additions & 1 deletion specs-jetpack/wp-jetpack-pressable.js
Expand Up @@ -28,6 +28,7 @@ import FacebookPage from '../lib/pages/external/facebook-page';
import ViewSitePage from '../lib/pages/view-site-page';
import ViewPostPage from '../lib/pages/view-post-page';
import JetpackComDebugPage from '../lib/pages/jetpack-com-debug-page';
import WpAdminCustomizerPage from '../lib/pages/wp-admin/wp-admin-customizer-page';

import LoginFlow from '../lib/flows/login-flow';

Expand Down Expand Up @@ -769,7 +770,11 @@ test.describe( `Jetpack on Pressable: '${ screenSize }'`, function() {

test.it( 'Can link to customize the related posts options within the Jetpack dashboard', function() {
this.jetpackSettingsPage.expandFeatureNamed( 'Related Posts' );
return this.jetpackSettingsPage.followSettingsLink( 'Related Posts' );
this.jetpackSettingsPage.followSettingsLink( 'Related Posts' );
this.wpAdminCustomizerPage = new WpAdminCustomizerPage( driver );
return this.wpAdminCustomizerPage.relatedPostsSectionShown().then( ( displayed ) => {
return assert( displayed, 'The related posts section is not shown in the Customizer' );
} );
} );

test.xit( 'Can use customizer to change related posts options', function() {
Expand Down

0 comments on commit 7721500

Please sign in to comment.