Skip to content

Commit 7624ded

Browse files
Fix cypress test with new classes
1 parent 0892d65 commit 7624ded

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

webapp/cypress/e2e/editPage.cy.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ describe("Edit Page", () => {
2626
it("Loads the main page without any errors", () => {
2727
cy.findByText("About").should("exist");
2828
cy.findByText("Samples").should("exist");
29-
cy.findByTestId("add-item-button").should("exist");
30-
cy.findByText("# of blocks").should("exist");
29+
cy.get('[data-testid="add-item-button"]').should("exist");
3130

3231
cy.contains("Server Error. Sample list could not be retreived.").should("not.exist");
3332
expect(consoleSpy).not.to.be.called;
@@ -306,7 +305,7 @@ describe("Edit Page", () => {
306305
cy.findByText("Add a block").click();
307306
cy.get('[data-testid="add-block-dropdown"]').findByText("Raman spectroscopy").click();
308307
cy.findAllByText("Select a file:").eq(2).should("exist");
309-
cy.get("select.file-select-dropdown")
308+
cy.get('[data-testid="file-select-dropdown"]')
310309
.eq(2)
311310
.select("example_data_raman_labspec_raman_example.txt");
312311
cy.contains("label", "X axis").should("exist");

webapp/cypress/support/commands.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,9 @@ Cypress.Commands.add("verifyStartingMaterial", (item_id, name = null, date = nul
318318
Cypress.Commands.add("expandIfCollapsed", (selector) => {
319319
cy.get(selector)
320320
.find("[data-testid=collapse-arrow]")
321-
.parents(".datablock-header")
322-
.then(($header) => {
323-
if (!$header.hasClass("expanded")) {
324-
cy.wrap($header).find("[data-testid=collapse-arrow]").click();
321+
.then(($arrow) => {
322+
if (!$arrow.hasClass("rotate-90")) {
323+
cy.wrap($arrow).click();
325324
}
326325
});
327326
});

webapp/src/components/SynthesisInformation.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div id="synthesis-information" class="mb-2">
2+
<div id="synthesis-information" data-testid="synthesis-block" class="mb-2">
33
<div class="d-flex align-items-center mb-2">
44
<font-awesome-icon
55
:icon="['fas', 'chevron-right']"

0 commit comments

Comments
 (0)