Skip to content

Commit

Permalink
add HelloWorld.js test step comment
Browse files Browse the repository at this point in the history
  • Loading branch information
smalltide committed Sep 28, 2019
1 parent a9b8c8e commit 983ba04
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions day12/HelloWorld.js
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!
});

0 comments on commit 983ba04

Please sign in to comment.