-
Notifications
You must be signed in to change notification settings - Fork 35
added new test for Deleting a seeding log on the Seeding Report Tab #229
base: main
Are you sure you want to change the base?
added new test for Deleting a seeding log on the Seeding Report Tab #229
Conversation
Please provide a description of your PR in and include a "Closes" line that links to the issue that will be resolved when the PR is merged. |
This issue happens sometimes in Cypress testing due to the way a particular component is being rendered in the browser. While it appears that the button is there, the browser for some reason believes that it is hidden behind another element. The fix is to add the |
.click((response) => { | ||
expect(response.status).to.equal(200) | ||
}) | ||
expect(true).to.equal(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point you'll need to check the contents of the table and the database to ensure that the deleted record does not appear in the report and that it has been removed from the database.
It would be very helpful if you could give the code you are using that is causing the error and also a clear illustration of the specific error that is caused. Please add the code that you are using to create the records and a screenshot of the error that is happening. |
context("Create a new logs, delete the log(s)", () => { | ||
let logID = null | ||
|
||
context("Adding logs, dates and testing for singular seeding log", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not have a context inside of another context.
This looks like it could be a timeout issue with the speed of the machine on which it is running. Try quitting any other applications that are running and see if that gets you past this point. I suggest that because when I ran the test it got past that point, but then failed later. The error that I was seeing is: Here it looks like you are getting |
I tried this possible solution, and received the same error message. There is no button element in the div when I looked on the developer tools. |
@udvale Nicely presented question! Well done.
I pulled your code, tried it out and reduced it to a small example that I was able to get to run. Below is the
|
@thorpIV This may be related to the organization of the tests overall. When I ran the code I posted above, I was able to get the delete button element with no error. So, I'd suggest that you check my reply to @udvale above and once you have the tests reorganized a little, see if it works for you. If not get back in touch if the problem persists. |
Also, there appears to be changes to a lot of files in this PR that are not related to the PR itself. It is possible that you can resolve those by synchronizing your |
Pull Request Description
The test allows you to create new logs and check if they are deleted from the database. The test accomplishes the following requirements to check whether the seeding report is deleting log(s) properly:
1.) When a single row is deleted from a table, the corresponding log is also removed from database.
2.) When multiple rows are deleted from a table, all the corresponding logs are removed from the database.
3.) When a row is checked to be deleted but cancels so no log is removed from the database.
Closes #205
Licensing Certification
FarmData2 is a Free Cultural Work and all accepted contributions are licensed as described in the LICENSE.md file. This requires that the contributor holds the rights to do so. By submitting this pull request I certify that I satisfy the terms of the Developer Certificate of Origin for its contents.