New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new E2E test for merchant transforming classic cart to cart block #44926
Conversation
Hi @adimoldovan, @woocommerce/solaris Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
Test Results SummaryCommit SHA: 62e1d17
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this test @veljkho.
It tested well to me, but I can you please take care of the page not being cleaned-up/unique?
const { admin } = require( '../../test-data/data' ); | ||
const { closeWelcomeModal } = require( '../../utils/editor' ); | ||
|
||
const transformedCartBlockTitle = 'Transformed Cart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use an unique page name, to ensure the right page gets tested on test re-runs?
const transformedCartBlockTitle = 'Transformed Cart'; | |
const transformedCartBlockTitle = `Transformed Cart ${ Date.now() }`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing @adimoldovan , added as suggested. 👍
test.afterAll( async ( { baseURL } ) => { | ||
const base64auth = Buffer.from( | ||
`${ admin.username }:${ admin.password }` | ||
).toString( 'base64' ); | ||
const wpApi = await request.newContext( { | ||
baseURL: `${ baseURL }/wp-json/wp/v2/`, | ||
extraHTTPHeaders: { | ||
Authorization: `Basic ${ base64auth }`, | ||
}, | ||
} ); | ||
let response = await wpApi.get( `pages` ); | ||
const allPages = await response.json(); | ||
await allPages.forEach( async ( page ) => { | ||
if ( page.title.rendered === transformedCartBlockTitle ) { | ||
response = await wpApi.delete( `pages/${ page.id }`, { | ||
data: { | ||
force: true, | ||
}, | ||
} ); | ||
} | ||
} ); | ||
} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The page deletion is not working, can you please make it work or remove the code if not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, it was removed in a new commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @veljkho, it looks good!
* Add show-prepublish-checks-section # Conflicts: # packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx # Conflicts: # packages/js/product-editor/src/components/prepublish-panel/style.scss * Add show-prepublish-checks hook * Refactor prepublish panel button visiblity # Conflicts: # packages/js/product-editor/src/components/header/header.tsx # Conflicts: # packages/js/product-editor/src/components/header/header.tsx * Fix footer styles * Add changelogs * Add content div * Fix styles # Conflicts: # packages/js/product-editor/src/components/prepublish-panel/style.scss * Rename recorded action * Fix styles * Hide panel after unchecking option * Improve resolving * Add new E2E test for merchant transforming classic cart to cart block (#44926) * Update the monorepo-utils gitignore to only include index.js and its license file. (#44932) * Fixed `@woocommerce/plugin-woocommerce` Watch (#44930) By default `nodemon` only watches for JS file changes. This expands the config so that it watch the file extensions that are actually produced by builds. * Update core package.json to remove nightly ci config (#45096) * Update core package.json to remove nightly ci config * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com> * Update blocks build message (#44811) * Update blocks build message * Add changefile(s) from automation for the following project(s): woocommerce * Update plugins/woocommerce/src/Blocks/Domain/Bootstrap.php Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> * Update plugins/woocommerce/src/Blocks/Domain/Bootstrap.php Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> * [CYS on Core] Update the themes list on the intro screen (#44822) * Update themes list on core. Update the themes data and remove hardcoded reference to free themes. * Update styles for the Free, Paid and active cards. * Add the color palletes to TT4 theme. * Update the references for default and core themes. * Add changefile(s) from automation for the following project(s): woocommerce * Update the link to TT4 theme * Update default value for price. --------- Co-authored-by: github-actions <github-actions@github.com> --------- Co-authored-by: Veljko V <veljano@yahoo.com> Co-authored-by: jonathansadowski <jonathansadowski@users.noreply.github.com> Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Roy Ho <roykho77@gmail.com> Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
* Add show-prepublish-checks-section # Conflicts: # packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx # Conflicts: # packages/js/product-editor/src/components/prepublish-panel/style.scss * Add show-prepublish-checks hook * Refactor prepublish panel button visiblity # Conflicts: # packages/js/product-editor/src/components/header/header.tsx # Conflicts: # packages/js/product-editor/src/components/header/header.tsx * Fix footer styles * Add changelogs * Add content div * Fix styles # Conflicts: # packages/js/product-editor/src/components/prepublish-panel/style.scss * Rename recorded action * Fix styles * Hide panel after unchecking option * Improve resolving * Add new E2E test for merchant transforming classic cart to cart block (#44926) * Update the monorepo-utils gitignore to only include index.js and its license file. (#44932) * Fixed `@woocommerce/plugin-woocommerce` Watch (#44930) By default `nodemon` only watches for JS file changes. This expands the config so that it watch the file extensions that are actually produced by builds. * Update core package.json to remove nightly ci config (#45096) * Update core package.json to remove nightly ci config * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com> * Update blocks build message (#44811) * Update blocks build message * Add changefile(s) from automation for the following project(s): woocommerce * Update plugins/woocommerce/src/Blocks/Domain/Bootstrap.php Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> * Update plugins/woocommerce/src/Blocks/Domain/Bootstrap.php Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> * [CYS on Core] Update the themes list on the intro screen (#44822) * Update themes list on core. Update the themes data and remove hardcoded reference to free themes. * Update styles for the Free, Paid and active cards. * Add the color palletes to TT4 theme. * Update the references for default and core themes. * Add changefile(s) from automation for the following project(s): woocommerce * Update the link to TT4 theme * Update default value for price. --------- Co-authored-by: github-actions <github-actions@github.com> --------- Co-authored-by: Veljko V <veljano@yahoo.com> Co-authored-by: jonathansadowski <jonathansadowski@users.noreply.github.com> Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Roy Ho <roykho77@gmail.com> Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Submission Review Guidelines:
Changes proposed in this Pull Request:
Added merchant test for transforming classic to block-based cart.
Closes # 637
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
pnpm test:e2e-pw ./tests/e2e-pw/tests/merchant/create-cart-block.spec.js
Changelog entry
Significance
Type
Message
Comment