Get a function that returns the active token. Args: state_inheritance: harness for StateInheritance app. driver: WebDriver instance. Returns: The token for the connected client
(state_inheritance: AppHarness, driver: WebDriver)
| 244 | |
| 245 | @pytest.fixture |
| 246 | def token(state_inheritance: AppHarness, driver: WebDriver) -> str: |
| 247 | """Get a function that returns the active token. |
| 248 | |
| 249 | Args: |
| 250 | state_inheritance: harness for StateInheritance app. |
| 251 | driver: WebDriver instance. |
| 252 | |
| 253 | Returns: |
| 254 | The token for the connected client |
| 255 | """ |
| 256 | assert state_inheritance.app_instance is not None |
| 257 | token_input = AppHarness.poll_for_or_raise_timeout( |
| 258 | lambda: driver.find_element(By.ID, "token") |
| 259 | ) |
| 260 | |
| 261 | # wait for the backend connection to send the token |
| 262 | token = state_inheritance.poll_for_value(token_input, timeout=DEFAULT_TIMEOUT * 2) |
| 263 | assert token is not None |
| 264 | |
| 265 | return token |
| 266 | |
| 267 | |
| 268 | def test_state_inheritance( |
nothing calls this directly
no test coverage detected