Authenticates against the server using the username and password passed in via environment variables. We need to support multiple test accounts at the same time, so this performs authentication for the test account `i`. Returns the username of the selected test account for convenience.
(&mut self, i: u8)
| 558 | /// |
| 559 | /// Returns the username of the selected test account for convenience. |
| 560 | pub(crate) async fn do_login(&mut self, i: u8) -> String { |
| 561 | let username = self.get_username(i); |
| 562 | let password = env::var(format!("TEST_ACCOUNT_{}_PASSWORD", i)) |
| 563 | .expect("Expected env config not found"); |
| 564 | let _response = self.service.login(&username, &password).await.unwrap(); |
| 565 | username |
| 566 | } |
| 567 | |
| 568 | /// Clears the authentication token to represent a log out. |
| 569 | pub(crate) async fn do_logout(&mut self) { |