Fix potential flaky test

This commit is contained in:
elazzabi 2024-03-19 15:34:47 +00:00 committed by Patricia Hillebrandt
parent 26c0fc3661
commit 77fa2813f2
1 changed files with 28 additions and 0 deletions

View File

@ -32,7 +32,35 @@ test.describe( 'Payment setup task', () => {
test( 'Can visit the WooPayments Connect page instead of setup task for supported countries', async ( {
page,
baseURL,
} ) => {
const api = new wcApi( {
url: baseURL,
consumerKey: process.env.CONSUMER_KEY,
consumerSecret: process.env.CONSUMER_SECRET,
version: 'wc/v3',
} );
// ensure store address is US
await api.post( 'settings/general/batch', {
update: [
{
id: 'woocommerce_store_address',
value: 'addr 1',
},
{
id: 'woocommerce_store_city',
value: 'San Francisco',
},
{
id: 'woocommerce_default_country',
value: 'US:CA',
},
{
id: 'woocommerce_store_postcode',
value: '94107',
},
],
} );
await page.goto( 'wp-admin/admin.php?page=wc-admin' );
await page.locator( 'text=Get paid' ).click();
await expect(