ไม้โปรแทรกเตอร์ - แตงกวาไม่เลือกค่าจากตัวอย่าง ฉันใช้ไซต์ http://juliemr.github.io/protractor-demo/ ในกล่องข้อความแรกที่ป้อน <key1>
และ <key2>
ไฟล์คุณสมบัติอยู่ด้านล่าง
คุณลักษณะ: นำทางไปยังไซต์เครื่องคิดเลขและเพิ่มตัวเลขสองตัว
สถานการณ์จำลอง: เพิ่มตัวเลขสองตัวโดยใช้ไซต์เครื่องคิดเลข
ให้นำทางไปยัง url ไซต์เครื่องคิดเลข http://juliemr.github.io/protractor-demo/
เมื่อระบุตัวเลขสองตัวเพื่อเพิ่มหมายเลขแรก < key1 >
และ < key2 >
จากนั้นคลิกที่ปุ่มเพิ่มบนเว็บไซต์เครื่องคิดเลข
โครงร่างสถานการณ์: ระบุพารามิเตอร์
ตัวอย่าง:
| key1 | key2 |
| 2 | 3 |
| 2 | 60 |
ไฟล์คำจำกัดความขั้นตอน
import { Given, When, Then } from "cucumber";
import { browser } from "protractor";
import { calculator } from "../pageObjects/calculator";
let cal = new calculator();
Given('Navigate to calculator site url {string}', async (string)=> {
// Write code here that turns the phrase above into concrete actions
await browser.get(string);
});
When('Provide two numbers to add first number {string} and {string}', async (firstValue:string,
secondvalue:string)=> {
// Write code here that turns the phrase above into concrete actions
await cal.firstEditBox.sendKeys(firstValue);
await cal.secondEditBox.sendKeys(secondvalue);
});
Then('Click on add button on calculator site', async ()=> {
// Write code here that turns the phrase above into concrete actions
await cal.goButton.click;
cal.getResult.getText().then(function(text) {
console.log(text);
})
});
ข้อผิดพลาด