Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Aug 11, 2021
1 parent 8791af5 commit 32a1fc5
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 37 deletions.
16 changes: 5 additions & 11 deletions cypress/integration/dialogs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("dialogs", function () {
cy.get(`[data-test="cutsiteHideShowTool"]`).click();
cy.contains(".veLabelText", "araD").rightclick();
cy.contains(".bp3-menu-item", "Create").click();
cy.contains(".bp3-menu-item", "New Feature").click();
cy.contains(".bp3-menu-item", "New Feature").click({ force: true });
cy.focused().type("new feat");
cy.screenshot();

Expand All @@ -49,10 +49,7 @@ describe("dialogs", function () {
cy.get(".tg-test-locations-1-start input").should("have.value", "29");
cy.get(".tg-test-locations-1-end input").should("have.value", "49");
});
it(`new feature dialog should
-not show a warning for a circular feature that fits within the sequence bounds if the sequence is circular
`, () => {
it(`new feature dialog should not show a warning for a circular feature that fits within the sequence bounds if the sequence is circular`, () => {
//open the new feature dialog
cy.get(".tg-menu-bar").contains("Edit").click();
cy.contains(".bp3-menu-item", "Create").click();
Expand All @@ -64,7 +61,7 @@ describe("dialogs", function () {
".bp3-menu-item.bp3-disabled",
"New Reverse Translation"
).should("exist");
cy.contains(".bp3-menu-item", "New Feature").click();
cy.contains(".bp3-menu-item", "New Feature").click({ force: true });
//change the start/end inputs to be making an origin spanning feature
cy.get(".tg-test-name input").clear().type("Fake name");
cy.get(".tg-test-start input").clear().type("400");
Expand All @@ -76,15 +73,12 @@ describe("dialogs", function () {
cy.get(".tg-test-start .bp3-intent-danger").should("not.exist");
cy.get(".veLabelText").contains("Fake name").should("be.visible");
});
it(`new part dialog should
-show a warning for a circular part that goes beyond the sequence
-not show a warning for a circular part that fits within the sequence bounds if the sequence is circular
`, () => {
it(`new part dialog should show a warning for a circular part that goes beyond the sequence and not show a warning for a circular part that fits within the sequence bounds if the sequence is circular`, () => {
//open the new feature dialog
cy.get(".tg-menu-bar").contains("Edit").click();

cy.contains(".bp3-menu-item", "Create").click();
cy.contains(".bp3-menu-item", "New Part").click();
cy.contains(".bp3-menu-item", "New Part").click({ force: true });
//change the start/end inputs to be making an origin spanning feature
cy.get(".tg-test-name input").clear().type("Fake name");
cy.get(".tg-test-start input").clear().type("400");
Expand Down
26 changes: 19 additions & 7 deletions cypress/integration/editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe("editor", function () {
);
cy.contains(".tg-menu-bar-item", "View").click();
cy.contains(".bp3-menu-item", "Limits").click();
cy.contains(".bp3-menu-item", "Max Cutsites To Show").click();
cy.contains(".bp3-menu-item", "Max Cutsites To Show").click({
force: true
});
cy.get(".bp3-menu-item:contains(100) .bp3-icon-small-tick");
cy.get(".bp3-menu-item:contains(400)").click({ force: true });
cy.get(".bp3-menu-item:contains(400) .bp3-icon-small-tick");
Expand Down Expand Up @@ -207,14 +209,16 @@ describe("editor", function () {
cy.get(".bp3-toast").contains("No Sequence Selected To Copy");
cy.get(".tg-menu-bar").contains("File").click();
cy.get(".bp3-menu-item").contains("Export Sequence").trigger("mouseover");
cy.contains(".bp3-menu-item", "Custom export option!").click();
cy.contains(".bp3-menu-item", "Custom export option!").click({
force: true
});
cy.get(".bp3-toast").contains("Custom export hit!");
});
it(`should handle custom dialog overrides correctly`, () => {
cy.tgToggle("overrideAddEditFeatureDialog");
cy.get(".tg-menu-bar").contains("Edit").click();
cy.contains(".bp3-menu-item", "Create").click();
cy.contains(".bp3-menu-item", "New Feature").click();
cy.contains(".bp3-menu-item", "New Feature").click({ force: true });
cy.contains("I Am Overridden. Any custom React can go here");
});
it(`should focus the linear view`, () => {
Expand Down Expand Up @@ -270,7 +274,9 @@ describe("editor", function () {
it(`should handle enabling external labels and then only showing labels that don't fit`, () => {
cy.get(".tg-menu-bar").contains("View").click();
cy.get(".tg-menu-bar-popover").contains("Labels").click();
cy.get(".tg-menu-bar-popover").contains("External Labels").click();
cy.get(".tg-menu-bar-popover")
.contains("External Labels")
.click({ force: true });
cy.get(".veTabProperties").contains("Properties").click();
cy.get(".veTabLinearMap").contains("Linear Map").click();
cy.contains("text", "pSC101**");
Expand All @@ -283,7 +289,9 @@ describe("editor", function () {
cy.get(".veLabelLine").should("have.css", "opacity", "0.1");
cy.get(".tg-menu-bar").contains("View").click();
cy.get(".tg-menu-bar-popover").contains("Labels").click();
cy.get(".tg-menu-bar-popover").contains("Label Line Intensity").click();
cy.get(".tg-menu-bar-popover")
.contains("Label Line Intensity")
.click({ force: true });
cy.get(".tg-menu-bar-popover").contains("High").click({ force: true });
cy.get(".veLabelLine").should("have.css", "opacity", "0.9");
});
Expand All @@ -294,7 +302,9 @@ describe("editor", function () {
);
cy.get(".tg-menu-bar").contains("View").click();
cy.get(".tg-menu-bar-popover").contains("Labels").click();
cy.get(".tg-menu-bar-popover").contains("Circular Label Size").click();
cy.get(".tg-menu-bar-popover")
.contains("Circular Label Size")
.click({ force: true });
cy.get(".tg-menu-bar-popover").contains("50%").click({ force: true });
cy.get(".veCircularViewLabelText").then((fiftyPercentText) => {
const halfFontSize = parseFloat(
Expand Down Expand Up @@ -346,7 +356,9 @@ describe("editor", function () {
it(`should handle very long external labels in RowView`, () => {
cy.get(".tg-menu-bar").contains("View").click();
cy.get(".tg-menu-bar-popover").contains("Labels").click();
cy.get(".tg-menu-bar-popover").contains("External Labels").click();
cy.get(".tg-menu-bar-popover")
.contains("External Labels")
.click({ force: true });
cy.contains(".veLabelText", "Part 0").rightclick();
cy.contains(".bp3-menu-item", "Edit Part").click();
const longName =
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/findTool.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe("find tool", function () {
.should("be.visible")
.rightclick(); //click the search layer
cy.contains(".bp3-menu-item", "Create").click();
cy.contains(".bp3-menu-item", "New Feature").click();
cy.contains(".bp3-menu-item", "New Feature").click({ force: true });
cy.contains(".bp3-radio", "Positive")
.find("input")
.should("not.be.checked");
Expand Down
26 changes: 15 additions & 11 deletions cypress/integration/menuBar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("menuBar", function () {
cy.contains(".bp3-menu-item", "Features").trigger("mouseover");
cy.contains(".bp3-menu-item", "Filter Individually")
.contains("22/22")
.trigger("mouseover");
.trigger("mouseover", { force: true });
cy.contains(".bp3-menu-item", "araD").click({ force: true });
cy.contains(".bp3-menu-item", "araC").click({ force: true });

Expand All @@ -35,7 +35,7 @@ describe("menuBar", function () {
cy.contains(".bp3-menu-item", "Parts").trigger("mouseover");
cy.contains(".bp3-menu-item", "Filter Individually")
.contains("3/3")
.trigger("mouseover");
.trigger("mouseover", { force: true });
cy.contains(".bp3-menu-item", "Part 0").click({ force: true });
cy.contains(".veLabelText", "Part 0").should("not.exist");
cy.contains(".bp3-menu-item", "Uncheck All").click({ force: true });
Expand All @@ -48,32 +48,36 @@ describe("menuBar", function () {
cy.get(`[data-test="cutsiteHideShowTool"]`).click();
cy.contains(".tg-menu-bar button", "View").click();
cy.contains(".bp3-menu-item", "Features").trigger("mouseover");
cy.get("[data-test=filter-feature-length]").click("top");
cy.get("[data-test=filter-feature-length]").click("top", { force: true });
cy.contains(".veLabelText", "pSC101**").should("not.exist");
cy.contains(".veLabelText", "araD").should("not.exist");
cy.contains(".veLabelText", "araC").should("not.exist");
cy.get('[data-test="max-feature-length"]').type("{selectall}900");
cy.get('[data-test="max-feature-length"]').type("{selectall}900", {
force: true
});
cy.contains(".veLabelText", "araD").should("exist");
cy.contains(".veLabelText", "araC").should("exist");
cy.get("[data-test=filter-feature-length]").click("top");
cy.get("[data-test=filter-feature-length]").click("top", { force: true });
cy.contains(".veLabelText", "pSC101**").should("exist");
});
it("Should be able to filter part by length", () => {
cy.get(`[data-test="cutsiteHideShowTool"]`).click();
cy.contains(".tg-menu-bar button", "View").click();
cy.contains("Part - pj5_00001 - Start: 1 End: 5299");
cy.contains(".bp3-menu-item", "Part").trigger("mouseover");
cy.get("[data-test=filter-part-length]").click("top");
cy.get("[data-test=filter-part-length]").click("top", { force: true });
cy.contains("Part - pj5_00001 - Start: 1 End: 5299").should("not.exist");
cy.get('[data-test="max-part-length"]').type("{selectall}6000");
cy.get('[data-test="max-part-length"]').type("{selectall}6000", {
force: true
});
cy.contains("Part - pj5_00001 - Start: 1 End: 5299");
});
it("Should be able to change circular/linear from the menu bar", () => {
cy.contains(".tg-menu-bar button", "Edit").click();
cy.contains(".bp3-menu-item", "Change Circular/Linear").trigger(
"mouseover"
);
cy.get(":nth-child(2) > .bp3-menu-item").click();
cy.get(":nth-child(2) > .bp3-menu-item").click({ force: true });
cy.contains("Truncate Annotations").click();
cy.contains(".tg-menu-bar button", "Edit").click();
cy.contains(".bp3-menu-item", "Change Circular/Linear").trigger(
Expand Down Expand Up @@ -104,11 +108,11 @@ describe("menuBar", function () {
cy.get(".tg-menu-bar").contains("Edit").click();
cy.contains(".rowViewTextContainer", "gacgtcttatga");
cy.contains(".bp3-menu-item", "Change Case").trigger("mouseover");
cy.contains(".bp3-menu-item", "Upper Case Sequence").click();
cy.contains(".bp3-menu-item", "Upper Case Sequence").click({ force: true });
cy.contains(".rowViewTextContainer", "GACGTCTTATGA");
cy.get(".tg-menu-bar").contains("Edit").click();
cy.contains(".bp3-menu-item", "Change Case").trigger("mouseover");
cy.contains(".bp3-menu-item", "Lower Case Sequence").click();
cy.contains(".bp3-menu-item", "Lower Case Sequence").click({ force: true });
cy.contains(".rowViewTextContainer", "gacgtcttatga");
});
it(`should be able permanently change selected sequence case`, () => {
Expand Down Expand Up @@ -138,7 +142,7 @@ describe("menuBar", function () {
cy.contains(".bp3-menu-item", "Features").trigger("mouseover");
cy.contains(".bp3-menu-item", "Filter By Type")
.contains("9/9")
.trigger("mouseover");
.trigger("mouseover", { force: true });
cy.contains(".veLabelText", "araD");
cy.contains(".veLabelText", "araC");
cy.contains(".bp3-menu-item", "misc_feature").click({ force: true });
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/partTags.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("partTags", function () {
it(`should be able to add/edit tags on parts`, () => {
cy.get(".veRowViewSelectionLayer").trigger("contextmenu", { force: true });
cy.contains(".bp3-menu-item", "Create").click();
cy.contains(".bp3-menu-item", "New Part").click();
cy.contains(".bp3-menu-item", "New Part").click({ force: true });
cy.focused().type("np");
cy.get(".tg-test-tags").click();
cy.contains(".bp3-menu-item", "status: ready").click();
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/partTypes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("partTypes", function () {
it(`should be able to add a part type`, () => {
cy.get(".veRowViewSelectionLayer").trigger("contextmenu", { force: true });
cy.contains(".bp3-menu-item", "Create").click();
cy.contains(".bp3-menu-item", "New Part").click();
cy.contains(".bp3-menu-item", "New Part").click({ force: true });
cy.get(".tg-test-type").click();
cy.contains(".tg-select-option", "misc_RNA").click();
cy.get(".tg-test-name input").type("test part");
Expand All @@ -60,7 +60,7 @@ describe("partTypes", function () {
it("should be able to make a part from feature", () => {
cy.get(".veRowViewSelectionLayer").trigger("contextmenu", { force: true });
cy.contains(".bp3-menu-item", "Create").click();
cy.contains(".bp3-menu-item", "New Feature").click();
cy.contains(".bp3-menu-item", "New Feature").click({ force: true });
cy.get(".tg-test-name input").type("test feature");
cy.get(".tg-test-end input").type("0");
cy.get(".tg-select").click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/proteinEditor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("proteinEditor", function () {
it(`feature/part add/edit should be AA indexed`, () => {
cy.get(".tg-menu-bar").contains("Edit").click();
cy.contains(".bp3-menu-item", "Create").click();
cy.contains(".bp3-menu-item", "New Feature").click();
cy.contains(".bp3-menu-item", "New Feature").click({ force: true });
cy.focused().type("NF");
cy.get(`.tg-test-start input[value="1"]`);
cy.get(`.tg-test-end [value="1"]`);
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/virtualDigest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe("virtualDigest", function () {
it(`users should be able to choose between multiple ladders`, () => {
cy.triggerFileCmd("Digest");
cy.contains("20000 bp");
cy.contains("15000 bp").should('not.exist');
cy.contains("15000 bp").should("not.exist");
cy.contains(".tg-select-value", "GeneRuler 1kb + DNA 75-20,000 bp");
cy.get(".tg-single-select").click();
cy.contains("Invitrogen 1kb").click();
Expand All @@ -26,7 +26,7 @@ describe("virtualDigest", function () {
it(`should give a right click create feature/part option and have the annotation name autofilled`, () => {
cy.triggerFileCmd("Digest");
cy.get(`[data-test="Pae17kI -- Cfr6I 5299 bps"]`).rightclick();
cy.contains(".bp3-menu-item", "New Part").click();
cy.contains(".bp3-menu-item", "New Part").click({ force: true });
cy.get(`.tg-test-name input`).should(
"have.value",
`Pae17kI -- Cfr6I 5299 bps`
Expand All @@ -38,7 +38,7 @@ describe("virtualDigest", function () {
cy.contains(".rt-td", "AvrII").click();
cy.get(".veSelectionLayer").first().rightclick();
cy.contains(".bp3-menu-item", "Create").click();
cy.contains(".bp3-menu-item", "New Feature").click();
cy.contains(".bp3-menu-item", "New Feature").click({ force: true });

cy.get(`.tg-test-name input`).should(
"have.value",
Expand Down

0 comments on commit 32a1fc5

Please sign in to comment.