2021-04-19 03:56:51 -07:00
|
|
|
import * as page from "./page";
|
|
|
|
|
2021-04-16 03:04:39 -07:00
|
|
|
// Give network requests a bit of breathing room!
|
|
|
|
const networkTimeout = { timeout: 12000 };
|
|
|
|
|
|
|
|
describe("WardrobePage: Basic outfit state", () => {
|
|
|
|
it("Initialize simple outfit from URL", () => {
|
|
|
|
cy.visit("/outfits/new?species=1&color=8&objects[]=76789");
|
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page
|
|
|
|
.getSpeciesSelect(networkTimeout)
|
2021-04-16 03:04:39 -07:00
|
|
|
.find(":selected")
|
|
|
|
.should("have.text", "Acara");
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getColorSelect().find(":selected").should("have.text", "Blue");
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.location().toMatchSnapshot();
|
|
|
|
|
|
|
|
cy.contains("A Warm Winters Night Background", networkTimeout).should(
|
|
|
|
"exist"
|
|
|
|
);
|
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitPreview().toMatchImageSnapshot();
|
2021-04-16 03:04:39 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Changes species and color", () => {
|
|
|
|
cy.visit("/outfits/new?species=1&color=8&objects[]=76789");
|
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page
|
|
|
|
.getSpeciesSelect(networkTimeout)
|
2021-04-16 03:04:39 -07:00
|
|
|
.find(":selected")
|
|
|
|
.should("have.text", "Acara");
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getColorSelect().find(":selected").should("have.text", "Blue");
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.location().toMatchSnapshot();
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitPreview().toMatchImageSnapshot();
|
2021-04-16 03:04:39 -07:00
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getSpeciesSelect().select("Aisha");
|
2021-04-16 03:04:39 -07:00
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getSpeciesSelect().find(":selected").should("have.text", "Aisha");
|
|
|
|
page.getColorSelect().find(":selected").should("have.text", "Blue");
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.location().toMatchSnapshot();
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitPreview().toMatchImageSnapshot();
|
2021-04-16 03:04:39 -07:00
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getColorSelect().select("Red");
|
2021-04-16 03:04:39 -07:00
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getSpeciesSelect().find(":selected").should("have.text", "Aisha");
|
|
|
|
page.getColorSelect().find(":selected").should("have.text", "Red");
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.location().toMatchSnapshot();
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitPreview().toMatchImageSnapshot();
|
2021-04-16 03:04:39 -07:00
|
|
|
});
|
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
it("Changes pose", () => {
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.visit("/outfits/new?species=1&color=8&pose=HAPPY_FEM");
|
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getPosePickerButton(networkTimeout).click();
|
|
|
|
page.getPosePickerOption("Happy and Feminine").should("be.checked");
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.location().toMatchSnapshot();
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitPreview().toMatchImageSnapshot();
|
2021-04-16 03:04:39 -07:00
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getPosePickerOption("Sad and Masculine").check({ force: true });
|
|
|
|
page.getPosePickerOption("Sad and Masculine").should("be.checked");
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.location().toMatchSnapshot();
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitPreview().toMatchImageSnapshot();
|
2021-04-16 03:04:39 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Toggles item", () => {
|
|
|
|
cy.visit("/outfits/new?species=1&color=8&objects[]=76789");
|
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitPreview().toMatchImageSnapshot();
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.location().toMatchSnapshot();
|
|
|
|
|
|
|
|
cy.contains("A Warm Winters Night Background").click();
|
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitPreview().toMatchImageSnapshot();
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.location().toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Renames outfit", () => {
|
|
|
|
cy.visit("/outfits/new?name=My+outfit&species=1&color=8");
|
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitName(networkTimeout).should("have.text", "My outfit");
|
2021-04-16 03:04:39 -07:00
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitName().click();
|
|
|
|
cy.focused().type("Awesome outfit{enter}");
|
2021-04-16 03:04:39 -07:00
|
|
|
|
2021-04-19 03:56:51 -07:00
|
|
|
page.getOutfitName().should("have.text", "Awesome outfit");
|
2021-04-16 03:04:39 -07:00
|
|
|
cy.location().toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|