Skip to content

Commit

Permalink
Merge pull request #44 from jeremyandrews/update-goose
Browse files Browse the repository at this point in the history
update goose to 0.15
  • Loading branch information
jeremyandrews authored Nov 2, 2021
2 parents 73fbd23 + 3221c50 commit aabeff8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "goose-eggs"
version = "0.3.0"
version = "0.3.1"
authors = ["Jeremy Andrews <[email protected]>"]
edition = "2018"
description = "Helpful in writing Goose load tests."
Expand All @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions examples/umami/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(&params), None).await?;
let mut saved_article = user
.post_form(&format!("en/node/{}/edit", article.unwrap().nid), &params)
.await?;

// A successful node save is redirected.
if !saved_article.request.redirected {
Expand Down
3 changes: 1 addition & 2 deletions examples/umami/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(&params), None).await?;
let mut goose = user.post_form(contact_form_url, &params).await?;

// Drupal 9 throttles how many times an IP address can submit the contact form, so we
// need special handling.
Expand Down
8 changes: 2 additions & 6 deletions src/drupal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,7 @@ pub async fn log_in(user: &mut GooseUser, login: &Login<'_>) -> Result<String, G
("form_id", &"user_login_form".to_string()),
("op", &"Log+in".to_string()),
];
let request_builder = user.goose_post("/user/login")?;
let mut logged_in_user = user.goose_send(request_builder.form(&params), None).await?;
let mut logged_in_user = user.post_form("/user/login", &params).await?;

// A successful log in is redirected.
if !logged_in_user.request.redirected {
Expand Down Expand Up @@ -1045,10 +1044,7 @@ pub async fn search<'a>(
}

// 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 {
Expand Down

0 comments on commit aabeff8

Please sign in to comment.