Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Commit

Permalink
clear by visiting admin home before tests. use onLoad rather than onB…
Browse files Browse the repository at this point in the history
…eforeLoad to set the supportsCTB value.
  • Loading branch information
circlecube committed Feb 2, 2024
1 parent dedae32 commit 552f0b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/cypress/integration/ctb.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ describe('Click to buy', function () {

before(() => {
cy.exec( 'npx wp-env run cli wp transient delete newfold_marketplace' );
cy.visit( '/wp-admin/index.php' );
cy.intercept({
method: 'GET',
url: /newfold-marketplace(\/|%2F)v1(\/|%2F)marketplace/
}, ctbProductsFixture ).as( 'ctbProductsFixture' );

cy.visit('/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/marketplace', {
onBeforeLoad() {
onLoad() {
cy.window().then((win) => {
win.nfdctb.supportsCTB = true;
win.NewfoldRuntime.capabilities.canAccessGlobalCTB = false;
Expand Down

0 comments on commit 552f0b2

Please sign in to comment.