Skip to content
Snippets Groups Projects
e2e.ts 2.2 KiB
Newer Older
  • Learn to ignore specific revisions
  • /*
     * Copyright (C) 2024 Das Land Schleswig-Holstein vertreten durch den
     * Ministerpräsidenten des Landes Schleswig-Holstein
     * Staatskanzlei
     * Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
     *
     * Lizenziert unter der EUPL, Version 1.2 oder - sobald
     * diese von der Europäischen Kommission genehmigt wurden -
     * Folgeversionen der EUPL ("Lizenz");
     * Sie dürfen dieses Werk ausschließlich gemäß
     * dieser Lizenz nutzen.
     * Eine Kopie der Lizenz finden Sie hier:
     *
     * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
     *
     * Sofern nicht durch anwendbare Rechtsvorschriften
     * gefordert oder in schriftlicher Form vereinbart, wird
     * die unter der Lizenz verbreitete Software "so wie sie
     * ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN -
     * ausdrücklich oder stillschweigend - verbreitet.
     * Die sprachspezifischen Genehmigungen und Beschränkungen
     * unter der Lizenz sind dem Lizenztext zu entnehmen.
     */
    
    // ***********************************************************
    
    // This example support/index.js is processed and
    
    // loaded automatically before your test files.
    //
    // This is a great place to put global configuration and
    // behavior that modifies Cypress.
    //
    // You can change the location of this file or turn off
    // automatically serving support files with the
    // 'supportFile' configuration option.
    //
    // You can read more here:
    // https://on.cypress.io/configuration
    // ***********************************************************
    
    
    // Import commands.js using ES2015 syntax:
    import 'cypress-mochawesome-reporter/register';
    import 'cypress-real-events';
    import 'cypress-timestamps/support';
    
    OZGCloud's avatar
    OZGCloud committed
    import './commands';
    
    
    Cypress.on('command:start', ({ attributes }) => {
      if (attributes.type === 'parent') {
        Cypress.log({
          name: `${new Date().toISOString()} - ${attributes.name}`,
        });
      }
    });
    
    Cypress.on('after:screenshot', ({ testFailure, takenAt }) => {
      if (testFailure) {
        console.log(`Error at: ${takenAt}`);
      }
    });
    
    Cypress.on('fail', (err) => {
      console.error(err);
      err.message = new Date().toISOString() + '\n' + err.message;
      throw err;
    });
    
    Cypress.Keyboard.defaults({
      keystrokeDelay: 30,
    });
    
    
    before(() => {
      Cypress.session.clearAllSavedSessions();
    });