0
我有一個TEXTBOX(只讀),它包含一些隨機值,例如對於ex。 2(這是產品數量)。 旁邊有一個按鈕(加號按鈕)和一個SPAN來顯示結果。Behat測試:從輸入中獲取一個值,將其乘以一個數字並匹配結果
現在每當我點擊加號按鈕時,它應該乘以5(這是產品的價格)到文本框中的數字(產品數量),並在SPAN中顯示結果。
<input type="text" readonly="readonly" value="2" id="product-qty" />
<button id="add-qty" value="Add Quantity"/>
<span id="show-result">10</span>
現在使用貝哈特測試我書面方式對上述方案一功能。 有人可以幫我寫這個。
問題是如何從文本框中獲取值並將其乘以5? 並將其與SPAN中的值匹配。
Scenario: Check product cart
Given I am on "detail-page"
When I click on the element "#add-qty"
#fetch value from the input multiply by it 5 and match the value with the content in the SPAN
And I wait 2000 milliseconds
Then I should see "Product added successfully"