Add todo tag for later fixing

This commit is contained in:
Rodel Calasagsag 2024-09-07 14:04:43 +08:00
parent c646236ac2
commit 024dc324f2
1 changed files with 99 additions and 87 deletions

View File

@ -84,7 +84,10 @@ test.describe( 'Add variations', { tag: '@gutenberg' }, () => {
}
} );
test( 'can manually add a variation', async ( { page } ) => {
test(
'can manually add a variation',
{ tag: '@todo-fix-in-multisite' },
async ( { page } ) => {
await test.step( `Open "Edit product" page of product id ${ productId_addManually }`, async () => {
await page.goto(
`/wp-admin/post.php?post=${ productId_addManually }&action=edit`
@ -98,12 +101,14 @@ test.describe( 'Add variations', { tag: '@gutenberg' }, () => {
window
.jQuery( '#variable_product_options' )
.on( 'woocommerce_variations_added', ( event, data ) => {
window.woocommerceVariationsAddedFunctionCalls.push( [
event,
data,
] );
} );
.on(
'woocommerce_variations_added',
( event, data ) => {
window.woocommerceVariationsAddedFunctionCalls.push(
[ event, data ]
);
}
);
} );
} );
@ -112,7 +117,9 @@ test.describe( 'Add variations', { tag: '@gutenberg' }, () => {
} );
await test.step( `Manually add ${ variationsToManuallyCreate.length } variations`, async () => {
const variationRows = page.locator( '.woocommerce_variation h3' );
const variationRows = page.locator(
'.woocommerce_variation h3'
);
let variationRowsCount = await variationRows.count();
const originalVariationRowsCount = variationRowsCount;
@ -131,7 +138,8 @@ test.describe( 'Add variations', { tag: '@gutenberg' }, () => {
// verify that the woocommerce_variations_added jQuery trigger was fired
const woocommerceVariationsAddedFunctionCalls =
await page.evaluate(
() => window.woocommerceVariationsAddedFunctionCalls
() =>
window.woocommerceVariationsAddedFunctionCalls
);
expect(
woocommerceVariationsAddedFunctionCalls.length
@ -142,7 +150,8 @@ test.describe( 'Add variations', { tag: '@gutenberg' }, () => {
for ( const attributeValue of variationToCreate ) {
const attributeName = productAttributes.find(
( { options } ) => options.includes( attributeValue )
( { options } ) =>
options.includes( attributeValue )
).name;
const addAttributeMenu = variationRows
.nth( 0 )
@ -153,7 +162,9 @@ test.describe( 'Add variations', { tag: '@gutenberg' }, () => {
} );
await test.step( `Select "${ attributeValue }" from the "${ attributeName }" attribute menu`, async () => {
await addAttributeMenu.selectOption( attributeValue );
await addAttributeMenu.selectOption(
attributeValue
);
} );
}
@ -184,5 +195,6 @@ test.describe( 'Add variations', { tag: '@gutenberg' }, () => {
} );
}
} );
} );
}
);
} );