Code review feedback

This commit is contained in:
zhongruige 2021-02-22 13:09:11 -07:00
parent 75aefa6325
commit 15825a5a13
1 changed files with 5 additions and 5 deletions

View File

@ -13,14 +13,14 @@ let variablePostIdValue;
const cartDialogMessage = 'Please select some product options before adding this product to your cart.'; const cartDialogMessage = 'Please select some product options before adding this product to your cart.';
const runVariableProductUpdateTest = () => { const runVariableProductUpdateTest = () => {
describe('Update variable product',() => { describe('Shopper > Update variable product',() => {
beforeAll(async () => { beforeAll(async () => {
await merchant.login(); await merchant.login();
variablePostIdValue = await createVariableProduct(); variablePostIdValue = await createVariableProduct();
await merchant.logout(); await merchant.logout();
}); });
it('can change variable attributes to the same value', async () => { it('shopper can change variable attributes to the same value', async () => {
await shopper.goToProduct(variablePostIdValue); await shopper.goToProduct(variablePostIdValue);
await expect(page).toSelect('#attr-1', 'val1'); await expect(page).toSelect('#attr-1', 'val1');
await expect(page).toSelect('#attr-2', 'val1'); await expect(page).toSelect('#attr-2', 'val1');
@ -29,7 +29,7 @@ const runVariableProductUpdateTest = () => {
await expect(page).toMatchElement('.woocommerce-variation-price', { text: '9.99' }); await expect(page).toMatchElement('.woocommerce-variation-price', { text: '9.99' });
}); });
it('can change attributes to combination with dimensions and weight', async () => { it('shopper can change attributes to combination with dimensions and weight', async () => {
await shopper.goToProduct(variablePostIdValue); await shopper.goToProduct(variablePostIdValue);
await expect(page).toSelect('#attr-1', 'val1'); await expect(page).toSelect('#attr-1', 'val1');
await expect(page).toSelect('#attr-2', 'val2'); await expect(page).toSelect('#attr-2', 'val2');
@ -41,7 +41,7 @@ const runVariableProductUpdateTest = () => {
await expect(page).toMatchElement('.woocommerce-product-attributes-item--dimensions', { text: '10 × 20 × 15 cm' }); await expect(page).toMatchElement('.woocommerce-product-attributes-item--dimensions', { text: '10 × 20 × 15 cm' });
}); });
it('can change variable product attributes to variation with a different price', async () => { it('shopper can change variable product attributes to variation with a different price', async () => {
await shopper.goToProduct(variablePostIdValue); await shopper.goToProduct(variablePostIdValue);
await expect(page).toSelect('#attr-1', 'val1'); await expect(page).toSelect('#attr-1', 'val1');
await expect(page).toSelect('#attr-2', 'val1'); await expect(page).toSelect('#attr-2', 'val1');
@ -50,7 +50,7 @@ const runVariableProductUpdateTest = () => {
await expect(page).toMatchElement('.woocommerce-variation-price', { text: '11.99' }); await expect(page).toMatchElement('.woocommerce-variation-price', { text: '11.99' });
}); });
it('can reset variations', async () => { it('shopper can reset variations', async () => {
await shopper.goToProduct(variablePostIdValue); await shopper.goToProduct(variablePostIdValue);
await expect(page).toSelect('#attr-1', 'val1'); await expect(page).toSelect('#attr-1', 'val1');
await expect(page).toSelect('#attr-2', 'val2'); await expect(page).toSelect('#attr-2', 'val2');