Giter Club home page Giter Club logo

nightwatch101's Introduction

Nightwatch101

手牽手一起來學 Nightwatch!

Nightwatch.js

安裝

簡易安裝步驟如下。

Step 1:安裝 Java Development Kit(JDK)

安裝 Java Development Kit(JDK),至少版本 7 以上。(適用 Windows 和 macOS)

在 Linux 用 apt 安裝:

sudo apt install openjdk-8-jdk # 版本號可以改

Step 2:下載專案

下載本專案並移動到此資料夾底下。

git clone https://github.com/cythilya/nightwatch101.git & cd nightwatch101

Step 3:安裝相關檔案

npm install

Step 4:啟動 Nightwatch,並進行測試

npm test

測試報告

安裝 nightwatch-html-reporter

npm install -g nightwatch-html-reporter

執行指令如下,跑一次測試程式,解析 Nightwatch 所產生的 XML 檔案,最後產生客製化測試報告。

nightwatch test/e2e/
nightwatch-html-reporter -d ./reports

教學

  1. 前言
  2. Nightwatch 與 Selenium Webdriver
  3. 環境建置
  4. 設定檔
  5. 使用 CSS Selector 定位網頁元素
  6. 使用 Xpath 定位網頁元素
  7. 指令 Part 1
  8. 指令 Part 2
  9. 指令 Part 3
  10. BDD Expect
  11. BDD Assert
  12. BDD Verify
  13. Test Hooks
  14. Asynchronous Test Hooks
  15. External Globals
  16. 簡單測試範例
  17. Nightwatch Test Runner
  18. 依照分組做測試(Test Groups)
  19. 依照標籤做測試(Test Tags)
  20. 禁跑特定測試(Disable Tests)
  21. 平行執行測試程式
  22. Page Objects
  23. 使用 Sections 優化 Page Objects
  24. 客製化指令(Custom Commands)
  25. 客製化斷言(Custom Assertions)
  26. 客製化測試報告
  27. 進階測試範例
  28. 獨立使用 ChromeDriver 跑測試
  29. Selenium IDE
  30. 總結

鐵人賽版

Todos

持續改進中,未來會繼續完成的項目...

  • localhost test
  • 設定假的 https certificate,然後 bypass https
  • 假資料填充、測完後移除
  • CI/CD 整合

nightwatch101's People

Contributors

cythilya avatar tigercosmos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.