Skip to content
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

Add support for conditional clicking #3623

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

brianhall
Copy link
Collaborator

@brianhall brianhall commented Dec 3, 2024

Task/Issue URL: https://app.asana.com/0/1199230911884351/1208647902506360/f
Tech Design URL:
CC:

Description:

Adds support for conditional clicking of elements by adding “choices” and “default” keys to the click action.

Optional E2E tests:

  • Run PIR E2E tests
    Check this to run the Personal Information Removal end to end tests. If updating CCF, or any PIR related code, tick this.

Steps to test this PR:
The easiest way to test whether the decoding is working is to setup one of the test files from the C-S-S integration tests as a fake broker:

  1. Download this file on your local machine. Open it to copy the file path, should start with file://
  2. Download this JSON and update the url to the file path you copied in 1.
  3. Save the JSON file in the macos-browser repo under LocalPackages/DataBrokerProtection/Sources/DataBrokerProtection/Resources/JSON
  4. Build the browser (no need for any special dependencies, just build main), then open the debug version of PIR: Debug Menu -> Personal Information Removal -> Run Personal Information Removal in Debug Mode.
  5. In Birth Year enter 1965, then select Test Broker in the list of brokers and click the Run button.
  6. After about 30 seconds, right click the webview and Inspect Element, then click the console tab and type window.location.href and hit enter. You should see a url that ends with #1, which means that the user was older than 45.
  7. Do steps 5-6 again, but for birth year enter 1990, when you do window.location.href you should get a url that ends with #2 instead, indicating that the user is < 45.
  8. Edit the mybrokertest.com.json file, copy/paste the contents of this gist in and save. This just sets the default case at the bottom to null.
  9. Run steps 5-7 again, this time window.location.href should return a url with no # at the end, meaning that nothing was clicked and no error was triggered.
  10. Edit the mybrokertest.com.json file again and remove line 45 (and the comma above on line 44) and then run steps 5-7 again. Step 5 should return no issues (and have a #1 hash at the end of the url), and step 7 should not return an error, but also not have any hash (e.g. #1) at the end of the url.

Definition of Done:

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@brianhall brianhall changed the title Add conditional clicking Add support for conditional clicking Dec 4, 2024
@brianhall
Copy link
Collaborator Author

I need something like this here, but keep getting stuck:

// Explicitly encode `null` if `defaultClick` is nil
if let defaultClick = defaultClick {
  try container.encode(defaultClick, forKey: .defaultClick)
} else {
  try container.encodeNil(forKey: .defaultClick)
}

@brianhall brianhall added bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project and removed bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project labels Dec 12, 2024
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.

1 participant