From 3221c5075db92edacd71f52541a8f59d19681fcd Mon Sep 17 00:00:00 2001 From: Jeremy Andrews Date: Tue, 2 Nov 2021 10:10:43 +0100 Subject: [PATCH] update goose to 0.15 --- CHANGELOG.md | 3 +++ Cargo.toml | 4 ++-- examples/umami/admin.rs | 5 +++-- examples/umami/common.rs | 3 +-- src/drupal.rs | 8 ++------ 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3967c2e..e8b0c30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.3.1 November 2, 2021 + - update goose to [0.15](https://github.com/tag1consulting/goose/releases/tag/0.15.0) + ## 0.3.0 October 26, 2021 - find forms identified with either `id=` or `data-drupal-selector=` - **API change**: introduce `SearchParamsBuilder` to build `SearchParams` objects diff --git a/Cargo.toml b/Cargo.toml index 50248c4..09211de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "goose-eggs" -version = "0.3.0" +version = "0.3.1" authors = ["Jeremy Andrews "] edition = "2018" description = "Helpful in writing Goose load tests." @@ -12,7 +12,7 @@ keywords = ["loadtesting", "performance", "web"] license = "Apache-2.0" [dependencies] -goose = "0.14" +goose = "0.15" log = "0.4" rand = "0.8" regex = "1.5" diff --git a/examples/umami/admin.rs b/examples/umami/admin.rs index ef8ca5f..6bc081b 100644 --- a/examples/umami/admin.rs +++ b/examples/umami/admin.rs @@ -70,8 +70,9 @@ pub async fn edit_article(user: &mut GooseUser) -> GooseTaskResult { ("form_id", &form_id), ("op", &"Save (this translation)".to_string()), ]; - let request_builder = user.goose_post(&format!("en/node/{}/edit", article.unwrap().nid))?; - let mut saved_article = user.goose_send(request_builder.form(¶ms), None).await?; + let mut saved_article = user + .post_form(&format!("en/node/{}/edit", article.unwrap().nid), ¶ms) + .await?; // A successful node save is redirected. if !saved_article.request.redirected { diff --git a/examples/umami/common.rs b/examples/umami/common.rs index b35ae36..4f64d1a 100644 --- a/examples/umami/common.rs +++ b/examples/umami/common.rs @@ -448,8 +448,7 @@ pub async fn anonymous_contact_form(user: &mut GooseUser, english: bool) -> Goos ("form_id", &form_id), ("op", "Send+message"), ]; - let request_builder = user.goose_post(contact_form_url)?; - let mut goose = user.goose_send(request_builder.form(¶ms), None).await?; + let mut goose = user.post_form(contact_form_url, ¶ms).await?; // Drupal 9 throttles how many times an IP address can submit the contact form, so we // need special handling. diff --git a/src/drupal.rs b/src/drupal.rs index 1d09fdd..f03f7fd 100644 --- a/src/drupal.rs +++ b/src/drupal.rs @@ -637,8 +637,7 @@ pub async fn log_in(user: &mut GooseUser, login: &Login<'_>) -> Result( } // Perform the search. - let request_builder = user.goose_post(params.url)?; - let goose = user - .goose_send(request_builder.form(&search_params), None) - .await?; + let goose = user.post_form(params.url, &search_params).await?; // Optionally validate the search results page. let validate = if let Some(validation) = params.results_page_validation {