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/tutorials-shortcut.test.js
Normal file
38
scratch-gui/test/integration/tutorials-shortcut.test.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import path from 'path';
|
||||
import SeleniumHelper from '../helpers/selenium-helper';
|
||||
|
||||
const {
|
||||
clickText,
|
||||
findByXpath,
|
||||
getDriver,
|
||||
loadUri
|
||||
} = new SeleniumHelper();
|
||||
|
||||
const uri = path.resolve(__dirname, '../../build/index.html?tutorial=all');
|
||||
const uriPrefix = path.resolve(__dirname, '../../build/index.html?tutorial=');
|
||||
|
||||
let driver;
|
||||
|
||||
describe('Working with shortcut to Tutorials library', () => {
|
||||
beforeAll(() => {
|
||||
driver = getDriver();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await driver.quit();
|
||||
});
|
||||
|
||||
test('opens with the Tutorial Library showing', async () => {
|
||||
await loadUri(uri);
|
||||
// make sure there is a tutorial visible that doesn't have a shortcut
|
||||
await clickText('Make It Spin');
|
||||
await findByXpath('//div[contains(@class, "step-video")]');
|
||||
});
|
||||
|
||||
test('can open hidden tutorials', async () => {
|
||||
await loadUri(`${uriPrefix}whatsnew`);
|
||||
// should open the tutorial video immediately
|
||||
await findByXpath('//div[contains(@class, "step-video")]');
|
||||
});
|
||||
// @todo navigating cards, etc.
|
||||
});
|
||||
Reference in New Issue
Block a user