-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import { Selector } from 'testcafe'; | ||
import { Selector } from 'testcafe'; // 引入 testcafe 的 html element 選擇器 | ||
|
||
fixture `Getting Started` | ||
.page `http:https://devexpress.github.io/testcafe/example`; | ||
fixture `Getting Started` // 設定測試集名稱 | ||
.page `http:https://devexpress.github.io/testcafe/example`; // 測試目標網頁 | ||
|
||
test('HelloWorld test', async t => { | ||
test('HelloWorld test', async t => { // 一個測試案例 | ||
await t | ||
.typeText('#developer-name', 'HelloWorld') | ||
.click('#submit-button') | ||
|
||
// Use the assertion to check if the actual header text is equal to the expected one | ||
.typeText('#developer-name', 'HelloWorld') //在文字框輸入 HelloWorld | ||
.click('#submit-button') //按下送出按鈕 | ||
.expect(Selector('#article-header').innerText).eql('Thank you, HelloWorld!'); | ||
// 使用 expect 驗證 #article-header 內的文字 等於 Thank you, HelloWorld! | ||
}); |