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

Seeding Report: Test Tray Seeding Summary Table #34 #173

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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')


});
});
Original file line number Diff line number Diff line change
@@ -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', '');
});
});