Skip to content
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

Merged
merged 2 commits into from Feb 23, 2024

Conversation

veljkho
Copy link
Contributor

@veljkho veljkho commented Feb 23, 2024

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:

  1. Checkout this branch locally
  2. Execute: pnpm test:e2e-pw ./tests/e2e-pw/tests/merchant/create-cart-block.spec.js
  3. Make sure it pass

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@veljkho veljkho self-assigned this Feb 23, 2024
@veljkho veljkho added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 23, 2024
@github-actions github-actions bot added the focus: e2e tests Issues related to e2e tests label Feb 23, 2024
@veljkho veljkho changed the title Add e2e merchant test transforming cart Add new E2E test for merchant transforming classic cart to cart block Feb 23, 2024
@veljkho veljkho requested review from a team February 23, 2024 15:30
Copy link
Contributor

github-actions bot commented Feb 23, 2024

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:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

github-actions bot commented Feb 23, 2024

Test Results Summary

Commit SHA: 62e1d17

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 37s
E2E Tests291005403457m 38s

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.

Copy link
Contributor

@adimoldovan adimoldovan left a 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';
Copy link
Contributor

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?

Suggested change
const transformedCartBlockTitle = 'Transformed Cart';
const transformedCartBlockTitle = `Transformed Cart ${ Date.now() }`;

Copy link
Contributor Author

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. 👍

Comment on lines 13 to 34
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,
},
} );
}
} );
} );
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@adimoldovan adimoldovan left a 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!

@adimoldovan adimoldovan merged commit 7018f2b into trunk Feb 23, 2024
34 checks passed
@adimoldovan adimoldovan deleted the e2e/add/merchant-cart-block branch February 23, 2024 17:51
@github-actions github-actions bot added this to the 8.8.0 milestone Feb 23, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Feb 23, 2024
octaedro added a commit that referenced this pull request Feb 26, 2024
* 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>
@alopezari alopezari added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Feb 26, 2024
Konamiman pushed a commit that referenced this pull request Mar 13, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: e2e tests Issues related to e2e tests plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants