from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC
Feature: Example feature Scenario: Successful login Given I have an account When I log in with valid credentials Then I should be redirected to the dashboard
6. Mocha
应用领域: JavaScript测试框架
特点:
非常灵活,支持多种联系方式测试(如异步)。
支持多种断言库(如 Chai)。
适合 Node.js 和前端JavaScript应用测试。
1 2 3 4 5 6 7 8 9
const assert = require('assert');
describe('Array', function() { describe('#indexOf()', function() { it('should return -1 when the value is not present', function() { assert.strictEqual([1, 2, 3].indexOf(4), -1); }); }); });