gpt4 book ai didi

php - 运行 behat 时出错

转载 作者:行者123 更新时间:2023-11-28 21:26:21 24 4
gpt4 key购买 nike

第一种情况可行,但第二种情况失败

特征文件:

And I click the "#redeem" element
And I wait for the ajax response
And I should see "OPERATOR CONTACT DETAILS AND INFORMATION WILL BE PROVIDED VIA EMAIL ON CONFIRMATION"
And I click the "#place_order" element
And I wait for the ajax response
Then I should see "Woohoo and thanks for booking!"

@javascript
Scenario: For checking mail in inbox of Gmail
Given I am on "https://gmail.com"
And I wait 12 seconds
And I fill in "Email" with "amit.dinda.prdxn@gmail.com"

水貂语境:

/**
* Fills in form field with specified id|name|label|value.
*
* @When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/
* @When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with:$/
* @When /^(?:|I )fill in "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/
*/
public function fillField($field, $value)
{
$field = $this->fixStepArgument($field);
$value = $this->fixStepArgument($value);
$this->getSession()->getPage()->fillField($field, $value);
}

错误信息:

 And I should see "OPERATOR CONTACT DETAILS AND INFORMATION WILL BE PROVIDED VIA EMAIL ON CONFIRMATION" # FeatureContext::assertPageContainsText()
And I click the "#place_order" element # FeatureContext::iClickTheElement()
And I wait for the ajax response # FeatureContext::iWaitForTheAjaxResponse()
Then I should see "Woohoo and thanks for booking!" # FeatureContext::assertPageContainsText()

@javascript
Scenario: For checking mail in inbox of Gmail # features/Redeem_a_Experience_voucher.feature:45
Given I am on "https://gmail.com" # FeatureContext::visit()
And I wait 12 seconds # FeatureContext::iWaitSeconds()
And I fill in "Email" with "amit.dinda.prdxn@gmail.com" # FeatureContext::fillField()
Form field with id|name|label|value|placeholder "Email" not found. (Behat\Mink\Exception\ElementNotFoundException)
And I click the "#next" element

如果以不同方式运行这两种情况,则它会正常工作。如果将这两种情况结合在一起,为什么它不起作用。

最佳答案

您应该在功能级别使用@insulated 标签。
此标记将确保您每次都有一个干净的 session 。

将此标记添加到功能文件的第一行,Feature 键之前。

You can use @javascript the same way at a feature level and it will apply for each scenario

关于php - 运行 behat 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39661562/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com