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

Direct seeding test #226

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 17 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,47 @@
describe('Test the tray seeding ', () => {
beforeEach(() => {
cy.login("manager1", "farmdata2");
cy.visit('/farm/fd2-barn-kit/seedingReport');
cy.waitForPage();
cy.get("[data-cy=start-date-select]").should("exist").type("2019-01-01");
cy.get("[data-cy=end-date-select]").should("exist").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");
})


it("Check total row feet plated", () => {
let total = 0;
for (let r=0; r <7; r++) {
cy.get("[data-cy = td-r"+r+ "c4]").invoke('text').then(value => {
total += parseInt(value);
cy.wrap(total).as("to");
});
}
cy.get('@to').then(tota => {
cy.get("[data-cy = direct-total-rowft]").should("have.text", tota.toString());
});
})

it("Check total bed feet plated", () => {
let total = 0;
for (let r=0; r <7; r++) {
cy.get("[data-cy = td-r"+r+ "c5]").invoke('text').then(value => {
total += parseInt(value);
cy.wrap(total).as("to");
});
}
cy.get('@to').then(tota => {
cy.get("[data-cy = direct-total-bedft]").should("have.text", tota.toString());
});
})

})




// cy.get("[data-cy = td-r"+1+ "c4]").invoke('text').then(value => {
// return total;
// }).invoke('text').should("equal", '26177');
// cy.get("[data-cy=direct-total-rowft]").should('have.text', '26177')
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
describe("Test the tray seeding ", () => {
beforeEach(() => {
cy.login("manager1", "farmdata2");
cy.visit('/farm/fd2-barn-kit/seedingReport');
cy.waitForPage();
});

it("generate multiple areas when 'All' is selected ", () => {
cy.get("[data-cy=date-range-selection]").should("exist");
cy.get("[data-cy=start-date-select]").should("exist").type("2019-01-01");
cy.get("[data-cy=end-date-select]").should("exist").type("2019-03-01");
cy.intercept("GET", "**/log.json**").as("getReport");
cy.get("[data-cy=generate-rpt-btn]").click();
cy.wait("@getReport");
cy.get("[data-cy=dropdown-input]").should("have.value", "All");
cy.get("[data-cy=r0-Area]").should("have.text", "ALF-4");
cy.get("[data-cy=r1-Area]").should("have.text", "ALF-2");
cy.get("[data-cy=r2-Area]").should("have.text", "CHUAU-2");
});

it("Test filter by area", () => {
cy.get("[data-cy=date-range-selection]").should("exist");
cy.get("[data-cy=start-date-select]").should("exist").type("2019-01-01");
cy.get("[data-cy=end-date-select]").should("exist").type("2019-03-01");
cy.intercept("GET", "**/log.json**").as("getReport");
cy.get("[data-cy=generate-rpt-btn]").click();
cy.wait("@getReport");

cy.get("[data-cy=area-dropdown] > [data-cy=dropdown-input]")
.select("CHUAU-3")
.should("have.value", "CHUAU-3")

cy.get("[data-cy=table-body]").children()
.should("have.length", 2)

for (let r = 0; r < 2; r++) {
cy.get("[data-cy=r" + r + "-" + "Area")
.should("have.text", "CHUAU-3")
}
})

it("Check the dropdown Area filter", () => {
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=area-dropdown] > [data-cy= dropdown-input]").children().should("have.length", 8);
cy.get("[data-cy=area-dropdown] > [data-cy = dropdown-input] > [data-cy= option0]").should("have.value", "All");
cy.get("[data-cy=area-dropdown] > [data-cy = dropdown-input] > [data-cy= option1]").should("have.value", "A");
cy.get("[data-cy=area-dropdown] > [data-cy = dropdown-input] > [data-cy= option2]").should("have.value", "ALF-2");
cy.get("[data-cy=area-dropdown] > [data-cy = dropdown-input] > [data-cy= option3]").should("have.value", "ALF-4");
cy.get("[data-cy=area-dropdown] > [data-cy = dropdown-input] > [data-cy= option4]").should("have.value", "CHUAU-2");
cy.get("[data-cy=area-dropdown] > [data-cy = dropdown-input] > [data-cy= option5]").should("have.value", "CHUAU-3");
cy.get("[data-cy=area-dropdown] > [data-cy = dropdown-input] > [data-cy= option6]").should("have.value", "PASTURE");
cy.get("[data-cy=area-dropdown] > [data-cy = dropdown-input] > [data-cy= option7]").should("have.value", "SEEDING BENCH");
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1 style='text-align:center;'>Seeding Input Log</h1>
<div v-show='(selectedSeedingType=="")' style='text-align:center;font-size: medium;'>
<p>Please Select Tray Seeding or Direct Seeding<label style='color: #da4f3f'>*</label></p>
</div>
<div v-show='(selectedSeedingType=="Tray Seedings")' style='padding: 12px; text-align:center; font-size: medium; margin-top: 45px;'>
<div data-cy="tray-selection" v-show='(selectedSeedingType=="Tray Seedings")' style='padding: 12px; text-align:center; font-size: medium; margin-top: 45px;'>
<dropdown-with-all data-cy="tray-area-selection" :selected-val='selectedArea' :dropdown-list='areaFilter' @selection-changed='setNewArea' style='width: 125px;' :disabled='submitInProgress'>Area:<label style='color: #da4f3f'>*</label></dropdown-with-all>
<br>
<label>Cells/Tray:<label style='color: #da4f3f'>*</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
describe('Test the tray seeding ', () => {
beforeEach(() => {
cy.login("manager1", "farmdata2")
cy.visit('/farm/fd2-field-kit/seedingInput')
})
it("Check the tray seeding section when 'Tray' is selected ", () => {
cy.get ("[data-cy=tray-seedings]").check()
cy.get("[data-cy=tray-selection]").should("be.visible")})

it("Check the dropdown Area ", () => {
cy.get ("[data-cy=tray-seedings]").check()
cy.get("[data-cy=tray-area-selection]>[data-cy=dropdown-input]").should("be.visible")
cy.get("[data-cy=tray-area-selection]>[data-cy=dropdown-input]").should("have.value",null)
})

it("Test area dropdown", () => {
cy.get("[data-cy=tray-seedings]").check()
cy.get("[data-cy=tray-area-selection] > [data-cy=dropdown-input]").children()
.should("have.length", 5)
cy.get("[data-cy=tray-area-selection] > [data-cy=dropdown-input] > [data-cy=option0")
.should("have.value", "CHUAU")
cy.get("[data-cy=tray-area-selection] > [data-cy=dropdown-input] > [data-cy=option2")
.should("have.value", "JASMINE")
cy.get("[data-cy=tray-area-selection] > [data-cy=dropdown-input] > [data-cy=option4")
.should("have.value", "SEEDING BENCH")
})

it("Test cells/tray field", () => {
cy.get("[data-cy=tray-seedings]").check()
cy.get("[data-cy=num-cell-input]")
.should("be.visible")
cy.get("[data-cy=num-cell-input] > [data-cy=text-input]")
.should("not.be.disabled")
.should("be.empty")
})

it("Check tray field", () => {
cy.get("[data-cy=num-tray-input]").should("not.visible");
cy.get("[data-cy=tray-seedings]").click();
cy.get("[data-cy=num-tray-input] > [data-cy=text-input]").should("be.visible")
.should("not.be.disabled")
.should("have.value","")
});

it("Check seed field", () => {
cy.get("[data-cy=num-seed-input] ").should("not.be.visible");
cy.get("[data-cy=tray-seedings]").click();
cy.get("[data-cy=num-seed-input] > [data-cy=text-input]").should("be.visible")
.should("not.be.disabled")
.should("have.value", "")
});
})