import { application } from './helpers'; const app = application; beforeEach(async (done) => { await app.start(); done(); }); describe('The app', () => { it('should display a warning when offline', async () => { await app.client.$('#who').then(e => e?.waitForDisplayed()); expect( // the text to say Hello React! await app.client.$('#who').then(e => e?.getText()) ).toBe('React'); // Change the value const newValue = 'WebDriverIO'; await app.client.$('input').then(e => e.setValue(newValue)); await app.client.pause(1000); // Click the button to change the text await app.client.$('button').then(e => e?.click()); await app.client.pause(1000); expect( // the text to say Hello WebDriverIO! await app.client.$('#who').then(e => e?.getText()) ).toBe(newValue); }); }); afterEach(async (done) => { if (app?.isRunning()) { await app.stop(); } done(); });