-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from 10up/bump/wp-ver
Bump WordPress "tested up to" version 6.7
- Loading branch information
Showing
9 changed files
with
86 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,6 @@ assets/js/shared/vendor | |
gulp-tasks/ | ||
webpack.config.babel.js | ||
gulpfile.babel.js | ||
node_modules | ||
tests/* | ||
vendor/* |
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
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 |
---|---|---|
@@ -1,23 +1,31 @@ | ||
describe('Check if Media Kit Block Pattern is available for use', () => { | ||
it('Can insert the block pattern', () => { | ||
cy.visitAdminPage('post-new.php'); | ||
cy.closeWelcomeGuide(); | ||
cy.get('#post-title-0, h1.editor-post-title__input').click( { force: true } ).type('Test Block Pattern'); | ||
cy.get('.edit-post-header-toolbar__inserter-toggle, .editor-document-tools__inserter-toggle').click(); | ||
cy.get('.components-tab-panel__tabs button, .block-editor-inserter__tabs button').contains( 'Patterns' ).click(); | ||
it('Can insert the block pattern', () => { | ||
cy.visitAdminPage('post-new.php'); | ||
cy.closeWelcomeGuide(); | ||
cy.get('#post-title-0, h1.editor-post-title__input') | ||
.click({ force: true }) | ||
.type('Test Block Pattern'); | ||
cy.get( | ||
'.edit-post-header-toolbar__inserter-toggle, .editor-document-tools__inserter-toggle', | ||
).click(); | ||
cy.get( | ||
'.components-tab-panel__tabs button, .block-editor-inserter__tabs button, .block-editor-tabbed-sidebar__tablist button', | ||
) | ||
.contains('Patterns') | ||
.click(); | ||
|
||
// (add version) If dropdown is available. (After WP 5.?) | ||
cy.get('body').then(($body) => { | ||
if ($body.find('.components-select-control__input').length > 0) { | ||
cy.get('.components-select-control__input').select('publisher-media-kit', { | ||
force: true, | ||
}); | ||
} else if ($body.find( '[aria-label="Publisher Media Kit"]' ).length > 0) { | ||
cy.get('[aria-label="Publisher Media Kit"]').click(); | ||
} | ||
// (add version) If dropdown is available. (After WP 5.?) | ||
cy.get('body').then(($body) => { | ||
if ($body.find('.components-select-control__input').length > 0) { | ||
cy.get('.components-select-control__input').select('publisher-media-kit', { | ||
force: true, | ||
}); | ||
} else if ($body.find('[aria-label="Publisher Media Kit"]').length > 0) { | ||
cy.get('[aria-label="Publisher Media Kit"]').click(); | ||
} | ||
|
||
// Check if cover patter exist in the list | ||
cy.get('[aria-label="Publisher Media Kit - Cover"]').should('exist'); | ||
}); | ||
}); | ||
// Check if cover patter exist in the list | ||
cy.get('[aria-label="Publisher Media Kit - Cover"]').should('exist'); | ||
}); | ||
}); | ||
}); |
79 changes: 39 additions & 40 deletions
79
tests/cypress/integration/pmk-media-kit-page-creation.test.js
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 |
---|---|---|
@@ -1,45 +1,44 @@ | ||
describe( 'Check if Media Kit page is created on plugin activation', () => { | ||
before( () => { | ||
cy | ||
.visitAdminPage( 'edit.php?post_type=page' ) | ||
.get( '#post-search-input' ) | ||
.clear() | ||
.type( 'Media Kit' ) | ||
.get( '#search-submit' ).click(); | ||
} ); | ||
describe('Check if Media Kit page is created on plugin activation', () => { | ||
before(() => { | ||
cy.visitAdminPage('edit.php?post_type=page') | ||
.get('#post-search-input') | ||
.clear() | ||
.type('Media Kit') | ||
.get('#search-submit') | ||
.click(); | ||
}); | ||
|
||
it( 'Activate Media Kit Plugin', () => { | ||
cy.get( 'body' ).then( ( $body ) => { | ||
if ( $body.find('[aria-label="Move “Media Kit” to the Trash"]' ).length > 0 ) { | ||
cy.get( '[aria-label="Move “Media Kit” to the Trash"]' ).click({ force: true }); | ||
} | ||
}); | ||
it('Activate Media Kit Plugin', () => { | ||
cy.get('body').then(($body) => { | ||
if ($body.find('[aria-label="Move “Media Kit” to the Trash"]').length > 0) { | ||
cy.get('[aria-label="Move “Media Kit” to the Trash"]').click({ force: true }); | ||
} | ||
}); | ||
|
||
cy. | ||
visitAdminPage( 'plugins.php' ) | ||
.get( '#deactivate-publisher-media-kit' ).click() | ||
.get( '#activate-publisher-media-kit' ).click() | ||
.get( '#deactivate-publisher-media-kit' ).should( 'be.visible' ); | ||
cy.visitAdminPage('plugins.php') | ||
.get('#deactivate-publisher-media-kit') | ||
.click() | ||
.get('#activate-publisher-media-kit') | ||
.click() | ||
.get('#deactivate-publisher-media-kit') | ||
.should('be.visible'); | ||
|
||
cy | ||
.get( '.updated.notice a' ) | ||
.invoke('attr', 'href') | ||
.then(href => { | ||
cy | ||
.request( href ) | ||
.its('status') | ||
.should('eq', 200); | ||
cy.get('.updated.notice a') | ||
.invoke('attr', 'href') | ||
.then((href) => { | ||
cy.request(href).its('status').should('eq', 200); | ||
}); | ||
}); | ||
|
||
}); | ||
} ); | ||
it('Ensure image URLs display correctly', () => { | ||
cy.visitAdminPage('edit.php?post_type=page'); | ||
|
||
it( 'Ensure image URLs display correctly', () => { | ||
cy.visitAdminPage( 'edit.php?post_type=page' ); | ||
|
||
cy.get( '#post-search-input' ).clear().type( 'Media Kit{Enter}' ); | ||
cy.get( 'a.row-title' ).first().click(); | ||
cy.get( '.wp-block img[src^="' + Cypress.config( 'baseUrl' ) + '"]' ).first().each( ( $img ) => { | ||
cy.request( $img.attr( 'src' ) ).its( 'status' ).should( 'eq', 200 ); | ||
} ); | ||
} ); | ||
} ); | ||
cy.get('#post-search-input').clear().type('Media Kit{Enter}'); | ||
cy.get('a.row-title').first().click(); | ||
cy.get(`.wp-block img[src^="${Cypress.config('baseUrl')}"]`) | ||
.first() | ||
.each(($img) => { | ||
cy.request($img.attr('src')).its('status').should('eq', 200); | ||
}); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
describe( 'Admin can login and make sure plugin is activated', () => { | ||
it( 'Can activate plugin if it is deactivated', () => { | ||
cy. | ||
visitAdminPage( 'plugins.php' ) | ||
.get( '#deactivate-publisher-media-kit' ).click() | ||
.get( '#activate-publisher-media-kit' ).click() | ||
.get( '#deactivate-publisher-media-kit' ).should( 'be.visible' ); | ||
} ); | ||
} ); | ||
describe('Admin can login and make sure plugin is activated', () => { | ||
it('Can activate plugin if it is deactivated', () => { | ||
cy.visitAdminPage('plugins.php') | ||
.get('#deactivate-publisher-media-kit') | ||
.click() | ||
.get('#activate-publisher-media-kit') | ||
.click() | ||
.get('#deactivate-publisher-media-kit') | ||
.should('be.visible'); | ||
}); | ||
}); |