Closed Rantzur1992 closed 3 years ago
Running the following code:
import { By } from 'selenium-webdriver'; import { Builder } from '@tpio/javascript-opensdk'; describe('Test example using chrome', () => { let driver; let mocha = require('mocha'); mocha.before(async () => { driver = new Builder() .forBrowser('chrome') .withProjectName('Examples') .withJobName('Example Job') .build(); }); mocha.after(async () => { await driver.quit(); }); it('Test 1', async () => { await driver.get('https://example.testproject.io/web/'); await driver.findElement(By.css('#name')).sendKeys('Test 1'); await driver.findElement(By.css('#password')).sendKeys('12345'); await driver.findElement(By.css('#login')).click(); const passed = await driver.findElement(By.css('#logout')).isDisplayed(); console.log(passed ? 'Test Passed' : 'Test Failed'); }); it('Test 2', async () => { await driver.get('https://example.testproject.io/web/'); await driver.findElement(By.css('#name')).sendKeys('Test 2'); await driver.findElement(By.css('#password')).sendKeys('12345'); await driver.findElement(By.css('#login')).click(); const passed = await driver.findElement(By.css('#logout')).isDisplayed(); console.log(passed ? 'Test Passed' : 'Test Failed'); }); });
Results in the following report:
Only the last test is reported, with all the previous tests steps inside.
Running the following code:
Results in the following report:
Only the last test is reported, with all the previous tests steps inside.