-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have GetAge() return -1 if Year is null, and fix return type #6888
Merged
DAcodedBEAT
merged 11 commits into
master
from
6887-bug-csvimport-fails-when-importing-birthdate-if-not-all-records-have-birthdate
Feb 29, 2024
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
681391e
Have GetAge() return -1 if Year is null, and fix return type
grayeul 1f38ba5
Add arg types and changing comparison on year to ===
grayeul 6720338
Mark Year as nullable
grayeul 879696c
Merge branch 'master' into 6887-bug-csvimport-fails-when-importing-bi…
grayeul 0a4b404
Merge branch 'master' into 6887-bug-csvimport-fails-when-importing-bi…
grayeul 57b0cbf
Update CSVImport to use SESSION to hold csvimport filename, also add …
grayeul 700c93c
Add new test for CSV import, and sample data to be used
grayeul b4cba13
Add record with Birthday, but no year, to verify can import only Mont…
grayeul 4d9dfe2
Add explicit id to fields needed for testing
grayeul 2992ed9
Reference specific DOM ids for elements needed
grayeul 1c016ad
Merge branch 'master' into 6887-bug-csvimport-fails-when-importing-bi…
grayeul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ImportTest,hasBday,"123 Main St", Downtown, TX, 77777,myBday@example.com,2001-07-04,888-555-1212 | ||
ImportTest,noYrBday,"123 Main St", Downtown, TX, 77777,noYrBday@example.com,0000-07-04,888-555-1212 | ||
ImportTest,noBday,"123 Main St", Downtown, TX, 77777,noBday@example.com,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
context("CSVImport", () => { | ||
it("Verify CSV Import", () => { | ||
cy.loginAdmin("CSVImport.php"); | ||
cy.get("input[type='file']").selectFile('cypress/data/test_import.csv') | ||
cy.get("input[type='submit']").click(); | ||
cy.contains('Total number of rows in the CSV file:3'); | ||
cy.get('#SelField0').select("Last Name",{force:true}); | ||
cy.get('#SelField1').select("First Name",{force:true}); | ||
cy.get('#SelField2').select("Address 1",{force:true}); | ||
cy.get('#SelField3').select("City",{force:true}); | ||
cy.get('#SelField4').select("State",{force:true}); | ||
cy.get('#SelField5').select("Zip",{force:true}); | ||
cy.get('#SelField6').select("Email",{force:true}); | ||
cy.get('#SelField7').select("Birth Date",{force:true}); | ||
cy.get('#SelField8').select("Home Phone",{force:true}); | ||
// Now that we have mapped the right fields, do the import | ||
cy.get("input[type='submit']").click(); | ||
DAcodedBEAT marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cy.contains('Data import successful.'); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@grayeul is
force: true
necessary here? https://docs.cypress.io/api/commands/select#Force-select seems to indicate that this is only useful for selecting hidden or disabled options, which shouldn't be the case here.If it is required (and we ensured that we can't avoid it), we should add a comment to explain why we did this
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.
I would love for someone else to be able to verify that. I couldn't get the select 'action' to work and tried multiple different ways, finally I added the
force:true
(which I saw in a few other tests) and then it worked! I agree that shouldn't have been necessary, as the fields were not hidden -- but that was my experience. I can add a comment for that.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.
I'm away from my test machine but I wonder if we need to
scrollIntoView
before selectingThere 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.
(Once we either get rid of the force or add a comment for why we did this, even if it's "it only worked when I did this", this PR should be good to merge)
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.
I don't think that was it... The screen is short, and it looked fine when I used the cypress gui, but still didn't select. I think it should have been in view from the start.