tutorials-shortcut.test.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import path from 'path';
  2. import SeleniumHelper from '../helpers/selenium-helper';
  3. const {
  4. clickText,
  5. findByXpath,
  6. getDriver,
  7. loadUri
  8. } = new SeleniumHelper();
  9. const uri = path.resolve(__dirname, '../../build/index.html?tutorial=all');
  10. const uriPrefix = path.resolve(__dirname, '../../build/index.html?tutorial=');
  11. let driver;
  12. describe('Working with shortcut to Tutorials library', () => {
  13. beforeAll(() => {
  14. driver = getDriver();
  15. });
  16. afterAll(async () => {
  17. await driver.quit();
  18. });
  19. test('opens with the Tutorial Library showing', async () => {
  20. await loadUri(uri);
  21. // make sure there is a tutorial visible that doesn't have a shortcut
  22. await clickText('Make It Spin');
  23. await findByXpath('//div[contains(@class, "step-video")]');
  24. });
  25. test('can open hidden tutorials', async () => {
  26. await loadUri(`${uriPrefix}whatsnew`);
  27. // should open the tutorial video immediately
  28. await findByXpath('//div[contains(@class, "step-video")]');
  29. });
  30. // @todo navigating cards, etc.
  31. });