Skip to content

Proposed changes to e2e helpers#1041

Merged
jordividaller merged 2 commits into
test/pbyr-3802-e2e-oboarding-scenariofrom
proposed-changes-to-e2e-helpers
May 22, 2026
Merged

Proposed changes to e2e helpers#1041
jordividaller merged 2 commits into
test/pbyr-3802-e2e-oboarding-scenariofrom
proposed-changes-to-e2e-helpers

Conversation

@gabrielseco
Copy link
Copy Markdown
Collaborator

@gabrielseco gabrielseco commented May 20, 2026

Note

Medium Risk
Medium risk because it changes core e2e form-filling helpers and selectors; tests may start failing if any form fields lack the expected data-field wrappers or if select behavior differs between native/custom dropdowns.

Overview
Refactors the Playwright fillForm helpers to locate inputs consistently via a required name mapped to [data-field="..."], removing prior cssId/dataField locator options and adding clearer errors when name is missing.

Adds nativeSelect support to fillSelect (using direct <select> selection vs role-based option clicking) and updates onboarding e2e helpers accordingly. The onboarding intro form UI is also updated to add data-field attributes around its inputs/select so the new locators work.

Reviewed by Cursor Bugbot for commit fd74540. Bugbot is set up for automated code reviews on this repo. Configure here.

@gabrielseco gabrielseco changed the base branch from main to test/pbyr-3802-e2e-oboarding-scenario May 20, 2026 07:15
@github-actions
Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 211.84 kB 211.84 kB +3 B (+0.0%) 🔴
Total (raw) 574.1 kB 574.1 kB 0 B (0%) 🟢
CSS (gzip) 20.86 kB 20.86 kB 0 B (0%) 🟢
CSS (raw) 108.83 kB 108.83 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 211.84 kB / 250 kB (84.7%)
  • ✅ Total raw: 574.1 kB / 600 kB (95.7%)
  • ✅ CSS gzipped: 20.86 kB / 25 kB (83.4%)

Largest Files (Top 5)

  1. chunk-5BU3CD2P.js - 14 kB (0 B (0%))
  2. styles.css - 10.43 kB (0 B (0%))
  3. index.css - 10.43 kB (0 B (0%))
  4. index.js - 6.11 kB (+2 B (+0.0%))
  5. chunk-ER46UFIU.js - 5.89 kB (0 B (0%))
View All Files (312 total)
File Size (gzip) Change
chunk-5BU3CD2P.js 14 kB 0 B (0%)
styles.css 10.43 kB 0 B (0%)
index.css 10.43 kB 0 B (0%)
index.js 6.11 kB +2 B (+0.0%)
chunk-ER46UFIU.js 5.89 kB 0 B (0%)
chunk-GIO4RGLD.js 5.81 kB 0 B (0%)
chunk-JXAAON7I.js 5.26 kB 0 B (0%)
chunk-X5ZZPJII.js 4.62 kB 0 B (0%)
chunk-Y5RLX6UH.js 4.45 kB 0 B (0%)
chunk-3PKL3V6F.js 4.06 kB 0 B (0%)

✅ Bundle size check passed

@github-actions
Copy link
Copy Markdown
Contributor

📊 Coverage Report

⚪ Coverage unchanged

Metric Current Previous Change Status
Lines 90.06% 90.06% 0%
Statements 89.73% 89.73% 0%
Functions 87.73% 87.73% 0%
Branches 80.11% 80.11% 0%

Detailed Breakdown

Lines Coverage
  • Covered: 3696 / 4104
  • Coverage: 90.06%
  • Change: 0% (0 lines)
Statements Coverage
  • Covered: 3756 / 4186
  • Coverage: 89.73%
  • Change: 0% (0 statements)
Functions Coverage
  • Covered: 1001 / 1141
  • Coverage: 87.73%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 2304 / 2876
  • Coverage: 80.11%
  • Change: 0% (0 branches)

✅ Coverage check passed

@github-actions
Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-74ik2pib0-remotecom.vercel.app
Latest Commit:28407ca

Deployed with vercel-action

export type FillFormOptions = {
type: inputType;
value?: string;
cssId?: string;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cssId its not longer needed

value?: string;
cssId?: string;
dataField?: string;
name?: string;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name is better in my opinion that data-field as input have the attribute name

.locator(`[data-field="${dataField}"] :is(input, textarea)`)
.fill(value);
}
await page.locator(`[data-field="${name}"] :is(input, textarea)`).fill(value);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can simplify the code to be in one line and remove all the ifs

if (dataField) {
const dropdown = page.locator(`[data-field="${dataField}"]`);
if (options.nativeSelect) {
const dropdown = page.locator(`[data-field="${name}"] select`);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as the select in the first form provided is different we can something like this

{ type: 'select', value: 'employee', cssId: '#type' },
{ type: 'textField', value: options.employment_id, cssId: '#employmentId' },
{ type: 'textField', value: options.external_id, cssId: '#externalId' },
{ type: 'textField', value: options.company_id, name: 'companyId' },
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the API is simplified to use name always

return (
<form onSubmit={handleSubmit} className='onboarding-form-container'>
<div className='onboarding-form-group'>
<div data-field='companyId' className='onboarding-form-group'>
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we make some changes in this form and that way we can fill inputs on the same way

@jordividaller jordividaller marked this pull request as ready for review May 22, 2026 10:00
@jordividaller jordividaller merged commit 604fb96 into test/pbyr-3802-e2e-oboarding-scenario May 22, 2026
1 check passed
@jordividaller jordividaller deleted the proposed-changes-to-e2e-helpers branch May 22, 2026 10:01
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit fd74540. Configure here.


if (dataField) {
await page
.locator(`[data-field="${dataField}"] :is(input, textarea)`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent parameter ordering between fill helper functions

Low Severity

fillTextField takes (page, name, value) while every other helper — fillSelect, fillComboBox, fillRadio, fillCheckbox, fillDatepicker — takes (page, value, name/locator). The call sites in fillForm happen to match each signature, so there's no active bug, but this inconsistent ordering across sibling functions in the same file is error-prone for anyone adding new call sites or refactoring.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fd74540. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants