Skip to content

Commit

Permalink
remame fixture file and alias to match and be unique and clear market…
Browse files Browse the repository at this point in the history
…place transient before running test
  • Loading branch information
circlecube committed Feb 1, 2024
1 parent 03db8cc commit 376c24f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
File renamed without changes.
9 changes: 6 additions & 3 deletions tests/cypress/integration/marketplace.cy.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
// <reference types="Cypress" />
const productsFixture = require( '../fixtures/products.json' );
const marketplaceProductsFixture = require( '../fixtures/marketplace-products.json' );

describe( 'Marketplace Page', function () {
const appClass = '.' + Cypress.env( 'appId' );

before( () => {

cy.exec( 'npx wp-env run cli wp transient delete newfold_marketplace' );

cy.intercept(
{
method: 'GET',
url: /newfold-marketplace(\/|%2F)v1(\/|%2F)marketplace/,
},
productsFixture
);
marketplaceProductsFixture
).as( 'marketplace_products' );

cy.visit(
'/wp-admin/admin.php?page=' +
Expand Down
6 changes: 4 additions & 2 deletions tests/cypress/integration/premium-plugins-tab.cy.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// <reference types="Cypress" />
const products = require( '../fixtures/products.json' );
const marketplaceProductsFixture = require( '../fixtures/marketplace-products.json' );

describe( 'Plugins Premium Tab', () => {
before( () => {
cy.exec( 'npx wp-env run cli wp transient delete newfold_marketplace' );

cy.intercept(
{
method: 'GET',
url: /newfold-marketplace(\/|%2F)v1(\/|%2F)marketplace/,
},
{
body: products,
body: marketplaceProductsFixture,
delay: 1000,
}
);
Expand Down

0 comments on commit 376c24f

Please sign in to comment.