Initial commit of 001code-html Scratch frontend project.
Includes scratch-gui, scratch-vm, scratch-blocks, scratch-render, scratch-l10n, and deployment config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
38
scratch-gui/test/integration/how-tos.test.js
Normal file
38
scratch-gui/test/integration/how-tos.test.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import path from 'path';
|
||||
import SeleniumHelper from '../helpers/selenium-helper';
|
||||
|
||||
const {
|
||||
clickText,
|
||||
clickXpath,
|
||||
findByXpath,
|
||||
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 clickText('Costumes');
|
||||
await clickXpath('//*[@aria-label="Tutorials"]');
|
||||
await clickText('Getting Started'); // Modal should close
|
||||
// Make sure YouTube video on first card appears
|
||||
await findByXpath('//div[contains(@class, "step-video")]');
|
||||
const logs = await getLogs();
|
||||
await expect(logs).toEqual([]);
|
||||
});
|
||||
|
||||
// @todo navigating cards, etc.
|
||||
});
|
||||
Reference in New Issue
Block a user