diff --git a/farmdata2/farmdata2_modules/fd2_barn_kit/seedingReport/seedingReportTraySummary.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_barn_kit/seedingReport/seedingReportTraySummary.defaults.spec.js new file mode 100644 index 00000000..7c1f1c18 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_barn_kit/seedingReport/seedingReportTraySummary.defaults.spec.js @@ -0,0 +1,37 @@ +describe('Tray Seeding Summary Table Validation', () => { + beforeEach(() => { + cy.login('manager1', 'farmdata2'); + cy.visit('/farm/fd2-barn-kit/seedingReport'); + cy.waitForPage(); + + }); + + it('exists and is visible when "All" or "Tray Seedings" is selected', () => { + cy.get("[data-cy=start-date-select]").type("2019-01-01"); + cy.get("[data-cy=end-date-select]").type("2019-03-01"); + cy.get("[data-cy=generate-rpt-btn]").click(); + ['All', 'Tray Seedings'].forEach(type => { + cy.get('[data-cy="seeding-type-dropdown"] > [data-cy="dropdown-input"]').select(type); + cy.get('[data-cy="tray-summary"]').should('be.visible'); + }); + }); + + it('does not exist or is not visible when "Direct Seedings" is selected', () => { + cy.get("[data-cy=start-date-select]").type("2019-01-01"); + cy.get("[data-cy=end-date-select]").type("2019-03-01"); + cy.get("[data-cy=generate-rpt-btn]").click(); + cy.get('[data-cy="seeding-type-dropdown"] > [data-cy="dropdown-input"]').select('Direct Seedings'); + cy.get('[data-cy="tray-summary"]').should('not.exist'); + }); + + it('the No Logs message appears with a table with no logs', () => { + cy.get("[data-cy=start-date-select]").type("2021-01-01"); + + cy.get('[data-cy=end-date-select]') + .type('2021-03-01') + cy.get('[data-cy=generate-rpt-btn]').click() + cy.get('[data-cy=no-logs-message]').should('be.visible') + + + }); + }); \ No newline at end of file diff --git a/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.tray.defaults.spec.js b/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.tray.defaults.spec.js new file mode 100644 index 00000000..96c2b9b8 --- /dev/null +++ b/farmdata2/farmdata2_modules/fd2_field_kit/seedingInput/seedingInput.tray.defaults.spec.js @@ -0,0 +1,27 @@ +describe("Check Tray Seeding Section", () => { + beforeEach(() => { + + cy.login("manager1", "farmdata2"); + cy.visit("farmdata2/farmdata2_modules/fd2_field_kit/seedingInput"); + + // Select the "Tray" button to display the Tray Seeding section + cy.get('[data-cy="tray-seedings"]').click(); + }); + + it("should display the Tray Seeding section fields correctly", () => { + // Check for visibility of the Tray Seeding section + cy.get("[data-cy='tray-area-selection']").should('be.visible'); + cy.get("[data-cy='num-cell-input']").should('be.visible'); + cy.get("[data-cy='num-tray-input']").should('be.visible'); + cy.get("[data-cy='num-seed-input']").should('be.visible'); + + + + // Verify that input fields for cells/tray, trays, and seeds are empty and enabled + cy.get('[data-cy="num-cell-input"] input').should('be.enabled').and('have.value', ''); + cy.get('[data-cy="num-tray-input"] input').should('be.enabled').and('have.value', ''); + cy.get('[data-cy="num-seed-input"] input').should('be.enabled').and('have.value', ''); + }); + }); + + \ No newline at end of file