Fix flaky test for creating variant (#2032)
* fix flaky test for creating variant * fix flaky
This commit is contained in:
parent
9c2ed377cc
commit
97eeccc917
3 changed files with 8 additions and 4 deletions
|
@ -88,7 +88,7 @@ filterTests({ definedTags: ["all", "critical", "refactored"] }, () => {
|
||||||
price,
|
price,
|
||||||
attribute: attributeValues[0]
|
attribute: attributeValues[0]
|
||||||
});
|
});
|
||||||
enterHomePageChangeChannelAndReturn(defaultChannel.name);
|
selectChannelInHeader(defaultChannel.name);
|
||||||
variantsShouldBeVisible({ name, price });
|
variantsShouldBeVisible({ name, price });
|
||||||
getProductVariants(createdProduct.id, defaultChannel.slug);
|
getProductVariants(createdProduct.id, defaultChannel.slug);
|
||||||
})
|
})
|
||||||
|
|
|
@ -46,6 +46,7 @@ export function createFirstVariant({
|
||||||
cy.addAliasToGraphRequest("ProductVariantBulkCreate")
|
cy.addAliasToGraphRequest("ProductVariantBulkCreate")
|
||||||
.get(VARIANTS_SELECTORS.nextButton)
|
.get(VARIANTS_SELECTORS.nextButton)
|
||||||
.click()
|
.click()
|
||||||
|
.confirmationMessageShouldAppear()
|
||||||
.waitForRequestAndCheckIfNoErrors("@ProductVariantBulkCreate")
|
.waitForRequestAndCheckIfNoErrors("@ProductVariantBulkCreate")
|
||||||
.waitForProgressBarToNotBeVisible()
|
.waitForProgressBarToNotBeVisible()
|
||||||
.get(AVAILABLE_CHANNELS_FORM.menageChannelsButton)
|
.get(AVAILABLE_CHANNELS_FORM.menageChannelsButton)
|
||||||
|
@ -68,7 +69,9 @@ export function createVariant({
|
||||||
.get(VARIANTS_SELECTORS.skuInput)
|
.get(VARIANTS_SELECTORS.skuInput)
|
||||||
.should("be.enabled")
|
.should("be.enabled")
|
||||||
.get(BUTTON_SELECTORS.back)
|
.get(BUTTON_SELECTORS.back)
|
||||||
.click();
|
.click()
|
||||||
|
.get(PRODUCT_DETAILS.productNameInput)
|
||||||
|
.should("be.enabled");
|
||||||
selectChannelForVariantAndFillUpPrices({
|
selectChannelForVariantAndFillUpPrices({
|
||||||
channelName,
|
channelName,
|
||||||
variantName: attributeName,
|
variantName: attributeName,
|
||||||
|
|
|
@ -64,8 +64,9 @@ export function selectChannelInPicker(channelName) {
|
||||||
export function selectChannelInHeader(channelName) {
|
export function selectChannelInHeader(channelName) {
|
||||||
cy.get(HEADER_SELECTORS.channelSelect).click();
|
cy.get(HEADER_SELECTORS.channelSelect).click();
|
||||||
cy.contains(SHARED_ELEMENTS.selectOption, channelName)
|
cy.contains(SHARED_ELEMENTS.selectOption, channelName)
|
||||||
.scrollIntoView()
|
.click({ force: true })
|
||||||
.click();
|
.get(SHARED_ELEMENTS.selectOption)
|
||||||
|
.should("not.exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function selectChannelInDetailsPages(channelName) {
|
export function selectChannelInDetailsPages(channelName) {
|
||||||
|
|
Loading…
Reference in a new issue