2021-04-22 02:44:45 -07:00
|
|
|
const withTestId = (testId) => (options) =>
|
|
|
|
cy.get(`[data-test-id="${CSS.escape(testId)}"]`, options);
|
2021-04-19 03:56:51 -07:00
|
|
|
|
2021-04-22 02:44:45 -07:00
|
|
|
export const getSpeciesSelect = withTestId("wardrobe-species-picker");
|
|
|
|
export const getColorSelect = withTestId("wardrobe-color-picker");
|
|
|
|
export const getPosePickerButton = withTestId("wardrobe-pose-picker");
|
|
|
|
export const getOutfitName = withTestId("outfit-name");
|
|
|
|
export const getSaveOutfitButton = withTestId("wardrobe-save-outfit-button");
|
|
|
|
export const getOutfitIsSavedIndicator = withTestId(
|
|
|
|
"wardrobe-outfit-is-saved-indicator"
|
|
|
|
);
|
2021-04-19 03:56:51 -07:00
|
|
|
|
|
|
|
export function getPosePickerOption(label, options) {
|
|
|
|
return cy.get(`input[aria-label="${CSS.escape(label)}"]`, options);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getOutfitPreview() {
|
|
|
|
return cy.get("[data-test-id=wardrobe-outfit-preview]:not([data-loading])", {
|
|
|
|
// A bit of an extra-long timeout, to await both server data and image data
|
|
|
|
timeout: 15000,
|
|
|
|
});
|
|
|
|
}
|