UNPKG

scratch-gui

Version:

GraphicaL User Interface for creating and running Scratch 3.0 projects

38 lines (30 loc) 934 B
import path from 'path'; import SeleniumHelper from '../helpers/selenium-helper'; const { clickText, clickXpath, getDriver, getLogs, loadUri } = new SeleniumHelper(); const uri = path.resolve(__dirname, '../../build/index.html'); let driver; describe('Working with the how-to library', () => { beforeAll(() => { driver = getDriver(); }); afterAll(async () => { await driver.quit(); }); test('Choosing a how-to', async () => { await loadUri(uri); await clickXpath('//button[@title="tryit"]'); await clickText('Costumes'); await clickXpath('//*[@aria-label="How-to Library"]'); await clickText('Say hello'); // Modal should close await clickText('Add a new sprite'); // Make sure first card appears const logs = await getLogs(); await expect(logs).toEqual([]); }); // @todo navigating cards, etc. });