Revert "Removed explicit timeout for offer creation helper"

This reverts commit ac427e4253.
This commit is contained in:
Elena Baidakova 2023-03-10 13:44:45 +04:00
parent ac427e4253
commit 6f9f83bee8
2 changed files with 7 additions and 6 deletions

View File

@ -14,7 +14,6 @@
@triggerClass="gh-contentfilter-menu-trigger"
@dropdownClass="gh-contentfilter-menu-dropdown"
@matchTriggerWidth={{false}}
data-testid="offers-type-select"
as |type|
>
{{#if type.name}}{{type.name}} offers{{else}}<span class="red">Unknown type</span>{{/if}}

View File

@ -295,11 +295,13 @@ const createOffer = async (page, {name, tierName, offerType, amount, discountTyp
.getByRole('button', {name: 'Archive'})
.click();
// waiting for offer to be archived
await expect(await page.locator('.modal-content')).toBeHidden();
await expect(await page.getByTestId('offers-type-select')).toBeVisible();
await page.getByTestId('offers-type-select').click();
// TODO: Use a more resilient selector
const statusDropdown = await page.getByRole('button', {name: 'Archived offers'});
await statusDropdown.waitFor({
state: 'visible',
timeout: 1000
});
await statusDropdown.click();
await page.getByRole('option', {name: 'Active offers'}).click();
}