Background
In T377757 we defined a specification for how a terms-of-service Popup in the experimental browser extension should look and behave. The goal of this task is to implement the *basic version* of this Popup that only appears when clicking the extension icon.
User story
As a user of the experimental browser extension, I want to be made aware of the experiment that is currently running, and I want to explicitly opt-in to the experiment.
Requirements
- Build a Popup window using Codex components with "agree" and "disagree" buttons that enable users to accept the terms-of-service.
- This popup should be marked as the "default_popup" in manifest.json, making it appear when someone clicks to extension icon.
- Maintain the terms of service state in the browser extension. This can be done using the Chrome.storage() API (similar to localstorage, but for extensions).
- The Popup should render different content based on whether or not someone agrees or disagrees with the terms-of-service. The popup should be rendered entirely via JS to switch between default and success/failure states.
BDD
Feature: Terms-of-service popup for browser extension
Scenario: Display default popup when extension icon is clicked
Given the browser extension is installed
And the user clicks the extension icon
Then the terms-of-service popup should appear in the default state with "agree" and "disagree" buttons
Scenario: User agrees to terms-of-service
Given the terms-of-service popup is displayed
When the user clicks "agree"
Then the popup changes to a "success" state displaying the current experiment
Scenario: User disagrees with terms-of-service
Given the terms-of-service popup is displayed
When the user clicks "disagree"
Then the popup changes to a "fail" state indicating they cannot participate in experiments
Scenario: User dismisses popup without selection
Given the terms-of-service popup is displayed
When the user dismisses the popup without choosing "agree" or "disagree"
Then the popup disappears
And the default popup should reappear upon clicking the extension icon againTest Steps
Test Case 1: Display Default Popup
- Install the browser extension.
- Click the extension icon.
- AC1: Confirm that a popup appears with “agree” and “disagree” buttons in the default state.
Test Case 2: User Agrees to Terms-of-Service
- Ensure the terms-of-service popup is open in the default state.
- Click “agree”.
- AC2: Verify the popup changes to a “success” state, displaying information about the current experiment.
- Confirm that Chrome.storage() is updated to record the agreement.
Test Case 3: User Disagrees to Terms-of-Service
- Ensure the terms-of-service popup is open in the default state.
- Click “disagree”.
- AC3: Confirm the popup changes to a “fail” state, informing the user they cannot participate in experiments.
Test Case 4: Dismiss Popup Without Selection
- Open the terms-of-service popup.
- Dismiss the popup without selecting “agree” or “disagree”.
- AC4: Verify the popup closes.
- Click the extension icon again.
- AC5: Confirm the popup reappears in the default state.
Design
| Default state |
| Success state |
| Failure state |
Acceptance criteria
- After installing the browser extension, when clicking on the extension icon, a popup should appear asking users to opt-in to the extension experiments. This is the "default" popup state.
- If the user clicks "agree", the popup should change to a "success" state where it lists the current experiment.
- If the user clicks "disagree", the popup should change to a "fail" state where users are told they cannot participate in experiments unless they agree to the ToC.
- If a user dismisses the Popup with no selected option, the popup dissapears. If they click it again, they are shown the "default" state.
- No experiments should run unless the the user agrees to the terms-of-service.
QA Results - Prod
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T378107#10323897 |
| 2 | ✅ | T378107#10323897 |
| 3 | ✅ | T378107#10323897 |
| 4 | ✅ | T378107#10323897 |
| 5 | ✅ | T378107#10323897 |
This task was created by Version 1.2.0 of the Web team task template using phabulous






