-
-
Notifications
You must be signed in to change notification settings - Fork 5
Add e2e tests #3137
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
base: master
Are you sure you want to change the base?
Add e2e tests #3137
Conversation
c44abb7
to
c6ce63d
Compare
if (projectName == null) throw new Error('Project name not found'); | ||
await page.getByRole('textbox', { name: 'Project Name' }).click(); | ||
await page.getByRole('textbox', { name: 'Project Name' }).click(); | ||
if (projectName == null) throw new Error('Project name not found'); |
Check notice
Code scanning / CodeQL
Unneeded defensive code Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 months ago
To fix the problem, we need to remove the redundant check projectName == null
on line 180. Since the projectName
variable can only be undefined
or a string, we should replace the check with projectName === undefined
. This will ensure that the code correctly handles the case where projectName
is not found without introducing unnecessary defensive code.
-
Copy modified line R180
@@ -179,3 +179,3 @@ | ||
await page.getByRole('textbox', { name: 'Project Name' }).click(); | ||
if (projectName == null) throw new Error('Project name not found'); | ||
if (projectName === undefined) throw new Error('Project name not found'); | ||
await page.getByRole('textbox', { name: 'Project name' }).fill(projectName); |
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.
No idea why it's saying this.
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #3137 +/- ##
=======================================
Coverage 81.98% 81.98%
=======================================
Files 604 604
Lines 34673 34673
Branches 5600 5622 +22
=======================================
Hits 28428 28428
+ Misses 5417 5405 -12
- Partials 828 840 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c6ce63d
to
511f1c6
Compare
511f1c6
to
240ee13
Compare
240ee13
to
da62195
Compare
da62195
to
70c712a
Compare
70c712a
to
05107a7
Compare
05107a7
to
ee77482
Compare
ee77482
to
a868388
Compare
a868388
to
8f539c4
Compare
8f539c4
to
c7d706b
Compare
Also removed executable flag from smoke-tests.mts
dae6fa5
to
76152a4
Compare
@pmachapman I've updated the files names to be more consistent. |
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.
Reviewable status: 33 of 38 files reviewed, 1 unresolved discussion (waiting on @marksvc and @pmachapman)
src/SIL.XForge.Scripture/ClientApp/e2e/e2e-utils.ts
line 74 at r3 (raw file):
Previously, pmachapman (Peter Chapman) wrote…
Is this an app bug, a test bug, or a test runner bug?
I don't remember. I do remember having a lot of issues with race conditions on the my projects page, and figuring out how to properly handle them.
That said, if (a) return true; else return false;
is hideous so I've fixed it.
if (projectName == null) throw new Error('Project name not found'); | ||
await page.getByRole('textbox', { name: 'Project Name' }).click(); | ||
await page.getByRole('textbox', { name: 'Project Name' }).click(); | ||
if (projectName == null) throw new Error('Project name not found'); |
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.
No idea why it's saying this.
127de15
to
9b207ce
Compare
This change is