Open braughtg opened 1 year ago
Group 1 will work on this ticket.
Since the HTML data generated on the page is done through farmOS, that means there will not be any "data-cy" attributes and they cannot be added. What are some effective ways to "cy.get" the HTML element for the tab? Is this time-efficient?
You can use alternative approaches for Cypress' "cy.get" which can include using unique attributes, IDs, classes, or CSS selectors associated with the tab element. It would work the same, and I don't think efficiency would be affected, but having "data-cy" attributes does make things easier.
FarmData2 adds the FieldKit tab to the farmOS user interface.
This test should check that:
Notes:
spec.js
for this test should be created in thecypress
directory in thefd2_field_kit
directory.Challenges:
data-cy
attributes, and you will not be able to add them. Thus, you will need to do some research to find an effective way tocy.get
the HTML element for the tab. The resources below may be helpful.Resources:
cy.get
finds elements in the page. We have useddata-cy
attributes up to this point. But there are other types of locators.cy.get
.Additional Information:
Some additional notes relevant to this issue:
.spec.js
file containing your test should be stored in an appropriate location and have a short but descriptive name. Use the locations and an naming from the "Good First issues" as examples..spec.js
file should include a comment at the top that describes what the file as a whole is testing.describe
should describe in a short phrase what the file is testing.beforeEach
method should callcy.waitForPage()
. This will ensure that the page is fully loaded (e.g. that all theMaps
used by the page are loaded) before performing any tests.it
for each of the things to be tested.it
s so that eachit
tests a cohesive set of things.it
should describe in a short phrase what theit
is testing..spec.js
files in thefarmdata2/farmdata2_modules/fd2_example/
sub-tabs (e.g.ui
,api
) may provide some helpful examples.docker/sampleDB/README.md
file.