Get a function that returns the active token. Args: computed_vars: harness for ComputedVars app. driver: WebDriver instance. Returns: The token for the connected client
(computed_vars: AppHarness, driver: WebDriver)
| 162 | |
| 163 | @pytest.fixture |
| 164 | def token(computed_vars: AppHarness, driver: WebDriver) -> str: |
| 165 | """Get a function that returns the active token. |
| 166 | |
| 167 | Args: |
| 168 | computed_vars: harness for ComputedVars app. |
| 169 | driver: WebDriver instance. |
| 170 | |
| 171 | Returns: |
| 172 | The token for the connected client |
| 173 | """ |
| 174 | assert computed_vars.app_instance is not None |
| 175 | token_input = AppHarness.poll_for_or_raise_timeout( |
| 176 | lambda: driver.find_element(By.ID, "token") |
| 177 | ) |
| 178 | |
| 179 | # wait for the backend connection to send the token |
| 180 | token = computed_vars.poll_for_value(token_input, timeout=DEFAULT_TIMEOUT * 2) |
| 181 | assert token is not None |
| 182 | |
| 183 | return token |
| 184 | |
| 185 | |
| 186 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected