課程簡介
第1天 – 介紹與基礎
介紹
-
Cypress在測試金字塔中的角色
-
測試自動化環境設置(Node LTS, npm)
-
創建一個最小的Cypress項目
-
在GUI和無頭模式下進行首次“煙霧”端到端測試
核心概念
-
Cypress基礎、命令隊列、自動重試
-
使用鉤子:before, beforeEach, afterEach, after
-
別名與可重用性(
.as(),cy.get('@alias'))
API(契約)測試
-
使用Cypress進行直接API測試(
cy.request()) -
使用
cy.intercept()進行API樁測試,處理邊緣情況 -
確保前端與後端的集成穩定性
自定義Cypress命令
-
將重複操作(登錄、導航)組織成自定義命令
-
使用可重用的調用編寫更清晰、可維護的代碼(
cy.login())
日程安排:理論+演示+實踐練習
先決條件:基本的JS知識,VSCode,Git
第2天 – 高級實踐與CI/CD
構建複雜測試
-
自動化完整用戶流程
-
使用
cy.intercept和cy.session進行狀態控制 -
避免不穩定測試,提高穩定性和速度
數據驅動測試
-
將測試數據存儲在JSON文件中(fixtures)
-
參數化測試,使用多個輸入運行相同邏輯
Cypress插件
-
報告:mochawesome, allure-cypress, junit-reporter
-
交互:cypress-file-upload, cypress-real-events
-
可訪問性:cypress-axe, cypress-audit
-
視覺迴歸:cypress-image-snapshot
-
可維護性:@testing-library/cypress, cypress-plugin-tab
使用Cypress的CI/CD
-
GitHub Actions集成
-
設置Node.js和Cypress環境,無頭執行
-
在push/PR時自動運行測試
-
安全處理密鑰
總結與結論
最低要求
- 對軟件測試的理解
受衆
- 軟件測試員
客戶評論 (5)
良好的融洽關係,Łukasz 有時間回答每個人的問題,並且能夠説明任何有任何問題的人
Kelly Morris - Titian Software Poland Sp. z o.o.
課程 - Selenium WebDriver in C#
機器翻譯
我喜歡一切,因為它對我來說都是新的,我可以看到它可以為我的工作帶來附加值。
Zareef - BMW South Africa
課程 - Tosca: Model-Based Testing for Complex Systems
機器翻譯
The trainer explained every functionality thoroughly.
Argean Quilaquil - DXC
課程 - TestComplete
Trainer is nice. His explanation is clear and interesting. He try to make the lessons interesting as possible. I enjoyed the lesson and gained a lot of knowledge. Thank you so much. The most useful technique I learned is the locating elements for different web component like textbox, radio buttons and buttons. Sometimes, the element ID is not capture correctly. We learned a different way of locating elements by using CSS selectors, XPath, Name and ID. I like the explanation. Thanks
Bee Chin Chuah - I-Access Solutions Pte Ltd
課程 - Advanced Selenium with C#
I liked how the examples lead to the next. You are able to use what you learnt in the previous segment in the next.