Busur Derajat - Mentimun tidak mengambil nilai dari Contoh. Saya menggunakan situs http://juliemr.github.io/protractor-demo/ di kotak teks pertama masuk <key1>
dan <key2>
.
File fitur ada di bawah
Fitur: Navigasikan ke situs kalkulator dan tambahkan dua angka
Skenario: Tambahkan dua angka menggunakan situs kalkulator
Diberikan Navigasi ke url situs kalkulator http://juliemr.github.io/protractor-demo/
Ketika Berikan dua angka untuk menambahkan angka pertama < key1 >
dan < key2 >
Kemudian Klik tombol tambah di situs kalkulator
Garis Besar Skenario: Berikan parameter
Contoh:
| key1 | key2 |
| 2 | 3 |
| 2 | 60 |
File definisi langkah
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);
})
});
Kesalahan