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 that should fail', async () => { await driver.get('https://example.testproject.io/web/'); await driver.findElement(By.css('#nam')).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'); }); });
Results a fail in Mocha:
But passes in the Reports:
Running the following code:
Results a fail in Mocha:
But passes in the Reports: