Disable Saleor_0702 for 3.5 or higher (#2182)
* update tests and snapshots * remove if for 3.5 version * remove deprecated test * fix tests after rebase with main
This commit is contained in:
parent
8a07f226e6
commit
c076d52f68
3 changed files with 49 additions and 9 deletions
|
@ -13,25 +13,39 @@ import { urlList } from "../../../fixtures/urlList";
|
|||
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
|
||||
import { createChannel } from "../../../support/api/requests/Channels";
|
||||
import {
|
||||
createShippingZone,
|
||||
createShippingZoneWithoutWarehouse,
|
||||
getShippingZone,
|
||||
} from "../../../support/api/requests/ShippingMethod";
|
||||
import { createWarehouse as createWarehouseViaApi } from "../../../support/api/requests/Warehouse";
|
||||
import { deleteChannelsStartsWith } from "../../../support/api/utils/channelsUtils";
|
||||
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
|
||||
import { deleteWarehouseStartsWith } from "../../../support/api/utils/warehouseUtils";
|
||||
import { returnValueDependsOnShopVersion } from "../../../support/formatData/dataDependingOnVersion";
|
||||
import { createChannelByView } from "../../../support/pages/channelsPage";
|
||||
|
||||
describe("Channels", () => {
|
||||
const channelStartsWith = `CyChannels`;
|
||||
const randomName = `${channelStartsWith} ${faker.datatype.number()}`;
|
||||
const randomName = `${channelStartsWith}${faker.datatype.number()}`;
|
||||
const currency = "PLN";
|
||||
let shippingZone;
|
||||
let usAddress;
|
||||
|
||||
before(() => {
|
||||
cy.clearSessionData().loginUserViaRequest();
|
||||
deleteChannelsStartsWith(channelStartsWith);
|
||||
deleteShippingStartsWith(channelStartsWith);
|
||||
createShippingZone(randomName, "US").then(shippingZoneResp => {
|
||||
shippingZone = shippingZoneResp;
|
||||
deleteWarehouseStartsWith(channelStartsWith);
|
||||
createShippingZoneWithoutWarehouse(randomName, "US").then(
|
||||
shippingZoneResp => {
|
||||
shippingZone = shippingZoneResp;
|
||||
},
|
||||
);
|
||||
cy.fixture("addresses").then(addresses => {
|
||||
usAddress = addresses.usAddress;
|
||||
createWarehouseViaApi({
|
||||
name: randomName,
|
||||
address: usAddress,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -85,9 +99,8 @@ describe("Channels", () => {
|
|||
.contains(randomChannel);
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
"should create channel with shippingZone. TC: SALEOR_0702",
|
||||
"should create channel with shippingZone and warehouse TC: SALEOR_0712",
|
||||
{ tags: ["@channel", "@allEnv"] },
|
||||
() => {
|
||||
// remove login after fixing SALEOR-3162
|
||||
|
@ -102,6 +115,7 @@ describe("Channels", () => {
|
|||
name: randomChannel,
|
||||
currency,
|
||||
shippingZone: shippingZone.name,
|
||||
warehouse: randomName,
|
||||
});
|
||||
cy.waitForRequestAndCheckIfNoErrors("@Channel");
|
||||
getShippingZone(shippingZone.id).then(shippingZoneResp => {
|
||||
|
|
9
cypress/support/api/utils/warehouseUtils.js
Normal file
9
cypress/support/api/utils/warehouseUtils.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
import * as warehouseRequest from "../requests/Warehouse";
|
||||
|
||||
export function deleteWarehouseStartsWith(startsWith) {
|
||||
cy.deleteElementsStartsWith(
|
||||
warehouseRequest.deleteWarehouse,
|
||||
warehouseRequest.getWarehouses,
|
||||
startsWith,
|
||||
);
|
||||
}
|
|
@ -13,7 +13,8 @@ export function createChannelByView({
|
|||
currency,
|
||||
slug = name,
|
||||
shippingZone,
|
||||
defaultCountry = "Poland"
|
||||
defaultCountry = "Poland",
|
||||
warehouse,
|
||||
}) {
|
||||
cy.addAliasToGraphRequest("Channel")
|
||||
.get(CHANNELS_SELECTORS.createChannelButton)
|
||||
|
@ -34,22 +35,38 @@ export function createChannelByView({
|
|||
});
|
||||
cy.fillAutocompleteSelect(
|
||||
ADD_CHANNEL_FORM_SELECTORS.countryAutocompleteInput,
|
||||
defaultCountry
|
||||
defaultCountry,
|
||||
);
|
||||
if (shippingZone) {
|
||||
addShippingZone(shippingZone);
|
||||
}
|
||||
if (warehouse) {
|
||||
addWarehouse(warehouse);
|
||||
}
|
||||
cy.get(ADD_CHANNEL_FORM_SELECTORS.saveButton).click();
|
||||
}
|
||||
|
||||
export function addShippingZone(shippingZone) {
|
||||
cy.get(BUTTON_SELECTORS.expandIcon)
|
||||
.first()
|
||||
.click()
|
||||
.get(ADD_CHANNEL_FORM_SELECTORS.addShippingZoneButton)
|
||||
.click()
|
||||
.fillAutocompleteSelect(
|
||||
ADD_CHANNEL_FORM_SELECTORS.shippingAutocompleteSelect,
|
||||
shippingZone
|
||||
shippingZone,
|
||||
);
|
||||
}
|
||||
|
||||
export function addWarehouse(warehouse) {
|
||||
cy.get(BUTTON_SELECTORS.expandIcon)
|
||||
.last()
|
||||
.click()
|
||||
.get(ADD_CHANNEL_FORM_SELECTORS.addWarehouseButton)
|
||||
.click()
|
||||
.fillAutocompleteSelect(
|
||||
ADD_CHANNEL_FORM_SELECTORS.warehouseAutocompleteSelect,
|
||||
warehouse,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue