title,body,link,tags,view_count,is_answered,score,answer_count
GitOps and e2e-Testing,"<p>we are currently setting up a GitOps-Workflow.
What I'm wondering is how to include our e2e-tests best.
As I would like to make sure, that the whole application runs flawlessly before allowing a merge-request to be approved the tests should run for every MR in the GitOps-Repository.
But where would the e2e-tests live then?
My gut-feeling is to add the e2e-tests to the GitOps-Repository as well, so that I only have one single MR if I want to change my deployment and have to add/modify the corresponding e2e-tests. But maybe there is a better solution? All I want to avoid is to have multiple MR in different repositories (one MR for e2e-tests and another one for GitOps), which have to play together or have to be executed/merged in a defined order.
How did you solve this challenge?</p>
",https://stackoverflow.com/questions/68457319/gitops-and-e2e-testing,"['architecture', 'repository', 'e2e-testing', 'continuous-deployment', 'gitops']",348,False,2,2
Angular E2E Testing Script Timeout,"<p>I'm new to Angular
I created a project with it which is working fine so far. But now I want to add some testing to it.</p>
<p>Unfortunately I'm not able to make it work.</p>
<p>So my app is a basic todo app.</p>
<p>In the test I want to check if task was created.</p>
<p><strong>This is my task-form.po.ts</strong></p>
<pre><code>import { by, element, ElementArrayFinder, ElementFinder } from 'protractor';

export class TaskForm {

  get taskCreateButton(): ElementFinder {
    return element(by.css('#task-create-btn'));
  }

  get taskListItems(): ElementArrayFinder {
    return element.all(by.css('mat-list-item'));
  }

  get taskForm(): ElementFinder {
    return element(by.id('task-form'));
  }

  get taskFormInput(): ElementFinder {
    return element(by.id('mat-input-0'));
  }
}
</code></pre>
<p><strong>app.e2e-spec.ts</strong></p>
<pre><code>...

describe('TaskForm', () =&gt; {
  let taskForm: TaskForm;
  let startCount: number;
  let createBtn: ElementFinder;
  let taskListItems: ElementArrayFinder;
  let taskFormNewInput: ElementFinder;
  let newTaskItemsNum: number;


  beforeEach( () =&gt; {
    taskForm = new TaskForm();
    createBtn = taskForm.taskCreateButton;
    taskListItems = taskForm.taskListItems;
    taskFormNewInput = taskForm.taskFormInput;
    taskListItems.count().then((originalCount: number) =&gt; {
      startCount = originalCount;
    });
  });

  it('should enter test task to task form', async () =&gt; {
    await taskFormNewInput.clear().then(() =&gt; {
      taskFormNewInput.sendKeys('This is a test task');
    });

    taskFormNewInput.getAttribute('value').then(taskInput =&gt; {
      expect(taskInput).toEqual('This is a test task');
    });
  });

  it('should add a task', async () =&gt; {
    await taskFormNewInput.clear().then(() =&gt; {
      taskFormNewInput.sendKeys('This is a test task');
    });

    await createBtn.click();
    newTaskItemsNum = await taskForm.taskListItems.count();
    expect(newTaskItemsNum).toBe(startCount);
  });
});
</code></pre>
<p>The task will be added but then it's running in a script timeout.</p>
<p>I tried several things but either the task will not be created or it's running in a script timeout.</p>
",https://stackoverflow.com/questions/66116289/angular-e2e-testing-script-timeout,"['angular', 'typescript', 'testing', 'protractor', 'e2e-testing']",489,False,0,1
Using test database when e2e-testing NestJS,"<p>In this project, it uses NestJS along with TypeORM. For real API requests, CRUD operation is being operated on MySQL(which is using AWS RDS).</p>
<p>Now I am trying to use SQLite(In-Memory) to test API results.</p>
<p>I successfully implemented this in Unit Test, as the code below.</p>
<p>First, below is <code>create-memory-db.ts</code>, which returns a connection to in-memory SQLite database.</p>
<pre><code>type Entity = Function | string | EntitySchema&lt;any&gt;;

export async function createMemoryDB(entities: Entity[]) {
  return createConnection({
    type: 'sqlite',
    database: ':memory:',
    entities,
    logging: false,
    synchronize: true,
  });
}
</code></pre>
<ul>
<li>And by using the exported function above, I successfully ran Unit test, like below.</li>
</ul>
<pre><code>describe('UserService Logic Test', () =&gt; {
  let userService: UserService;
  let connection: Connection;
  let userRepository: Repository&lt;User&gt;;

  beforeAll(async () =&gt; {
    connection = await createMemoryDB([User]);
    userRepository = await connection.getRepository(User);
    userService = new UserService(userRepository);
  });

  afterAll(async () =&gt; {
    await connection.close();
  });

  afterEach(async () =&gt; {
    await userRepository.query('DELETE FROM users');
  });

  // testing codes.
});
</code></pre>
<p>I am trying to do the same thing on e2e tests. I tried below code.</p>
<pre><code>// user.e2e-spec.ts

describe('UserController (e2e)', () =&gt; {
  let userController: UserController;
  let userService: UserService;
  let userRepository: Repository&lt;User&gt;;
  let connection: Connection;
  let app: INestApplication;
  const NAME = 'NAME';
  const EMAIL = 'test@test.com';
  const PASSWORD = '12345asbcd';

  beforeAll(async () =&gt; {
    connection = await createMemoryDB([User]);
    userRepository = await connection.getRepository(User);
    userService = new UserService(userRepository);
    userController = new UserController(userService);

    const moduleFixture: TestingModule = await Test.createTestingModule({
      imports: [],
      controllers: [UserController],
      providers: [UserService],
    }).compile();

    app = moduleFixture.createNestApplication();
    await app.init();
  });

  afterAll(async () =&gt; {
    await connection.close();
  });

  afterEach(async () =&gt; {
    // await userRepository.query('DELETE FROM users');
  });

  it('[POST] /user : Response is OK if conditions are right', () =&gt; {
    const dto = new UserCreateDto();
    dto.name = NAME;
    dto.email = EMAIL;
    dto.password = PASSWORD;

    return request(app.getHttpServer())
      .post('/user')
      .send(JSON.stringify(dto))
      .expect(HttpStatus.CREATED);
  });
});
</code></pre>
<p>I cannot create <code>UserModule</code> since it doesn't have a constructor with <code>Connection</code> parameter.
The code itself has no compile error, but gets results below when e2e test is executed.</p>
<pre><code>Nest can't resolve dependencies of the UserService (?). Please make sure that the argument UserRepository at index[0] is available in the RootTestModule context.

Potential solutions:
- If UserRepository is a provider, is it part of the current RootTestModule?
- If UserRepository is exported from a seperate @Module, is that module imported within RootTestModule?
  @Module({
    imports: [/* The module containing UserRepository */]
  })


TypeError: Cannot read property 'getHttpServer' of undefined.
</code></pre>
<p>Any help would be greatly appreciated. Thanks :)</p>
<hr/>
<ul>
<li>UPDATE : New error occured after trying below.</li>
</ul>
<pre><code>describe('UserController (e2e)', () =&gt; {
  let userService: UserService;
  let userRepository: Repository&lt;User&gt;;
  let connection: Connection;
  let app: INestApplication;
  const NAME = 'NAME';
  const EMAIL = 'test@test.com';
  const PASSWORD = '12345asbcd';

  beforeAll(async () =&gt; {
    connection = await createMemoryDB([User]);
    userRepository = await connection.getRepository(User);
    userService = new UserService(userRepository);

    const moduleFixture: TestingModule = await Test.createTestingModule({
      imports: [UserModule],
    })
      .overrideProvider(UserService)
      .useClass(userService)
      .compile();

    app = moduleFixture.createNestApplication();
    await app.init();
  });

  afterAll(async () =&gt; {
    await connection.close();
  });

  afterEach(async () =&gt; {
    await userRepository.query('DELETE FROM users');
  });

  it('[POST] /user : Response is OK if conditions are right', async () =&gt; {
    const dto = new UserCreateDto();
    dto.name = NAME;
    dto.email = EMAIL;
    dto.password = PASSWORD;

    const result = await request(app.getHttpServer())
      .post('/user')
      .send(JSON.stringify(dto))
      .expect({ status: HttpStatus.CREATED });
  });
});
</code></pre>
<ul>
<li>I checked if query is working, and was able to see that it is using SQLite database as I wanted. But new error appeared in console.</li>
</ul>
<pre><code>TypeError: metatype is not a constructor.

TypeError: Cannot read property 'getHttpServer' of undefined.
</code></pre>
",https://stackoverflow.com/questions/66193796/using-test-database-when-e2e-testing-nestjs,"['javascript', 'nestjs', 'e2e-testing', 'typeorm']",14416,True,12,2
Override provider in single test in nest.js e2e testing,"<p>I have e2e test of module with controller and some providers:</p>
<pre><code>beforeAll(async () =&gt; {
    const moduleRef = await Test.createTestingModule({
      controllers: [TestController],
      providers: [
        TestService,
        {
          provide: getRepositoryToken(TestEntity),
          useValue: {
            find: jest.fn(async () =&gt; testDatabaseResult),
            save: jest.fn(),
          },
        },
      ],
    }).compile();

    app = moduleRef.createNestApplication();
    app.use(cookieParser());
    app.useGlobalPipes(new ValidationPipe());

    await app.init();
  });
</code></pre>
<p>I'm mocking here database connection by mocking TestEntity repository and it's working fine - real implementation of service gets mocked database query result. However in one single test I need to TestEntity provider use mock find function with different implementation:</p>
<pre><code>find: jest.fn(async () =&gt; otherMockedTestDatabaseResult)
</code></pre>
<p>How can I achieve that? I want to use real implementation of TestService which under the hood uses TestEntity repository which is mocked (and I don't want to use test database). Thank you in advance for help.</p>
",https://stackoverflow.com/questions/69133345/override-provider-in-single-test-in-nest-js-e2e-testing,"['nestjs', 'e2e-testing', 'nestjs-testing']",1830,True,3,2
How to implement e2e testing in Nest JS Framework,"<p>I am new this Framework. I implemented crud operation, migration, unit testing also but I do know how to implement e2e testing in nest JS Framework. I tried to run the e2e testing program it's throwing an error
How to fix this error. I tried many ways but I could not get the solution
<a href=""https://i.stack.imgur.com/5hjwa.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/5hjwa.png"" alt=""enter image description here"" /></a>It showing this error <strong>No repository for &quot;UserEntity&quot; was found. Looks like this entity is not registered in current &quot;default&quot; connection?</strong>. So, I tried to change my database configuration</p>
<p><strong>Database configuration</strong></p>
<pre><code>{
              type: 'postgres',
              host:  process.env[`${process.env.NODE_ENV}_POSTGRES_HOST`],
              port: parseInt(process.env[`${process.env.NODE_ENV}_POSTGRES_PORT`]) || 5432,
              username: process.env[`${process.env.NODE_ENV}_POSTGRES_USER`],
              password: process.env[`${process.env.NODE_ENV}_POSTGRES_PASSWORD`],
              database: process.env[`${process.env.NODE_ENV}_POSTGRES_DATABASE`],
              entities: [&quot;dist/**/*.entity{ .ts,.js}&quot;],
              migrations: [&quot;dist/database/migration/*.js&quot;],
              cli:{
                  migrationsDir: 'src/database/migration',
                  }
            }
</code></pre>
<p>This problem is occurred in the <strong>entities column</strong> in the database configuration. If I change the entities directory the application cannot run. how to fix this issue</p>
<p><strong>tsconfig.json</strong></p>
<pre><code>{
  &quot;compilerOptions&quot;: {
    &quot;module&quot;: &quot;commonjs&quot;,
    &quot;declaration&quot;: true,
    &quot;removeComments&quot;: true,
    &quot;emitDecoratorMetadata&quot;: true,
    &quot;experimentalDecorators&quot;: true,
    &quot;allowSyntheticDefaultImports&quot;: true,
    &quot;target&quot;: &quot;es2017&quot;,
    &quot;sourceMap&quot;: true,
    &quot;outDir&quot;: &quot;./dist&quot;,
    &quot;baseUrl&quot;: &quot;./&quot;,
    &quot;incremental&quot;: true
  }
}
</code></pre>
",https://stackoverflow.com/questions/66988418/how-to-implement-e2e-testing-in-nest-js-framework,"['node.js', 'nestjs', 'nestjs-swagger', 'nestjs-config', 'nestjs-passport']",6361,True,1,1
How to write e2e testing for a angular project,"<p>I am completely new in angular, now working on a project Angular where e2e tests are written using protractor.
Do any one suggest how to write testcases using e2e for curd operations.</p>
",https://stackoverflow.com/questions/67866587/how-to-write-e2e-testing-for-a-angular-project,"['angular', 'protractor', 'e2e-testing']",73,False,0,1
nestjs e2e testing graphql using supertest response error 404,"<p>when i run e2e test :</p>
<p>and this is</p>
<p><strong>app.Module.ts</strong></p>
<pre><code>@Module({
  imports: [
    GraphQLModule.forRoot({
      cors: {
        origin: process.env.FRONTENDURL,
        credentials: true,
      },
      installSubscriptionHandlers: true,
      autoSchemaFile: 'src/schema.gql',
      context: ({ req, res, url }) =&gt; ({
        headers: req.headers,
        res,
        url: req.protocol + '://' + req.headers.host,
      }),
    }),
    ScheduleModule.forRoot(),
    UserModule,
    BusinessModule,
    PrismaModule,
    ReviewModule,
    LikeModule,
    FollowModule,
    ImageModule,
    LocationModule,
    CategoryModule,
    ReportModule,
    ClaimModule,
    FeedModule,
  ],
  controllers: [UserController],
  providers: [ClaimResolver, ClaimService],
})
export class AppModule {}
</code></pre>
<p>and
<strong>main.ts</strong></p>
<pre><code>import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import * as cookieParser from 'cookie-parser';
import { NestExpressApplication } from '@nestjs/platform-express';

async function bootstrap() {
  const app = await NestFactory.create&lt;NestExpressApplication&gt;(AppModule, {
    cors: true,
  });
  app.use(cookieParser('Secret'));
  app.enableCors({
    origin: process.env.FRONTENDURL,
    credentials: true,
  });
  //app.setViewEngine('hbs');
  await app.listen(5000);
}
bootstrap();
</code></pre>
<p>so here is my</p>
<p><strong>app.e2e-spec.ts</strong></p>
<pre><code>import { Test, TestingModule } from '@nestjs/testing';
import { ExecutionContext, INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { AppModule } from './../src/app.module';
import { GqlExecutionContext } from '@nestjs/graphql';
import { AuthGuard } from '../src/utils/auth/auth.guard';

const gql = '/graphql';

describe('AppController (e2e)', () =&gt; {
  let app: INestApplication;
  beforeAll(async () =&gt; {
    const moduleFixture: TestingModule = await Test.createTestingModule({
      imports: [AppModule],
    }).compile();

    app = moduleFixture.createNestApplication();
    await app.init();
  });

  afterAll(async () =&gt; {
    await app.close();
  });

it('loged in', async () =&gt; {
    const result = await request(app.getHttpServer())
      .post(gql)
      .send({
        query: `mutation login{
        login(data:{
          email:&quot;alaa@gmail.com&quot;,
          password: &quot;alaa01151116980&quot;,
        }){
          token
          user{
            userName
            id
          }
        }
      }`,
      })
      // .expect(404)
      .expect((response) =&gt; {
        expect(response.body.data.login.token).toEqual(
          expect.objectContaining({
            login: {
              token: expect.any(String),
            },
          }),
        );
      });
  });
});
</code></pre>
<p>and i got the error</p>
<pre><code>● AppController (e2e) › loged in

    TypeError: Cannot read property 'login' of undefined

      108 |       // .expect(404)
      109 |       .expect((response) =&gt; {
    &gt; 110 |         expect(response.body.data.login.token).toEqual(
          |                                   ^
      111 |           expect.objectContaining({
      112 |             login: {
      113 |               token: expect.any(String),

      at app.e2e-spec.ts:110:35
      at ../node_modules/supertest/lib/test.js:80:15
      at Test.Object.&lt;anonymous&gt;.Test._assertFunction (../node_modules/supertest/lib/test.js:311:11)
      at Test.Object.&lt;anonymous&gt;.Test.assert (../node_modules/supertest/lib/test.js:201:21)
      at Server.localAssert (../node_modules/supertest/lib/test.js:159:12)

A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks.
Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        30.379 s
Ran all test suites.

Watch Usage
 › Press f to run only failed tests.
 › Press o to only run tests related to changed files.
 › Press p to filter by a filename regex pattern.
 › Press t to filter by a test name regex pattern.
 › Press q to quit watch mode.
 › Press Enter to trigger a test run.
</code></pre>
<p>when i change the response in <strong>app.e2e-spec.ts</strong> file to:</p>
<pre><code>it('loged in', async () =&gt; {
    const result = await request(app.getHttpServer())
      .post(gql)
      .send({
        query: `mutation login{
        login(data:{
          email:&quot;alaa@gmail.com&quot;,
          password: &quot;alaa01151116980&quot;,
        }){
          token
          user{
            userName
            id
          }
        }
      }`,
      })
      // .expect(404)
      .expect((response) =&gt; {
        expect(response).toEqual(
          expect.objectContaining({
            login: {
              token: expect.any(String),
            },
          }),
        );
      });
  });
</code></pre>
<p>i have the recived response</p>
<pre><code>● AppController (e2e) › loged in

    expect(received).toEqual(expected) // deep equality

    Expected: ObjectContaining {&quot;login&quot;: {&quot;token&quot;: Any&lt;String&gt;}}
    Received: {&quot;header&quot;: {&quot;connection&quot;: &quot;close&quot;, &quot;content-length&quot;: &quot;147&quot;, &quot;content-security-policy&quot;: &quot;default-src 'none'&quot;, &quot;content-type&quot;: &quot;text/html; charset=utf-8&quot;, &quot;date&quot;: &quot;Fri, 07 May 2021 03:30:24 GMT&quot;, &quot;x-content-type-options&quot;: &quot;nosniff&quot;, &quot;x-powered-by&quot;: &quot;Express&quot;}, &quot;req&quot;: {&quot;data&quot;: {&quot;query&quot;: &quot;mutation login{ 
            login(data:{
              email:\&quot;alaa@gmail.com\&quot;,
              password: \&quot;alaa01151116980\&quot;,
            }){
              token
              user{
                userName
                id
              }
            }
          }&quot;}, &quot;headers&quot;: {&quot;content-type&quot;: &quot;application/json&quot;}, &quot;method&quot;: &quot;POST&quot;, &quot;url&quot;: &quot;http://127.0.0.1:55679/graphql&quot;}, &quot;status&quot;: 404, &quot;text&quot;: &quot;&lt;!DOCTYPE 
html&gt;
    &lt;html lang=\&quot;en\&quot;&gt;
    &lt;head&gt;
    &lt;meta charset=\&quot;utf-8\&quot;&gt;
    &lt;title&gt;Error&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;pre&gt;Cannot POST /graphql&lt;/pre&gt;
    &lt;/body&gt;
    &lt;/html&gt;
    &quot;}

      108 |       // .expect(404)
      109 |       .expect((response) =&gt; {
    &gt; 110 |         expect(response).toEqual(
          |                          ^
      111 |           expect.objectContaining({
      112 |             login: {
      113 |               token: expect.any(String),

      at app.e2e-spec.ts:110:26
      at ../node_modules/supertest/lib/test.js:80:15
      at Test.Object.&lt;anonymous&gt;.Test._assertFunction (../node_modules/supertest/lib/test.js:311:11)
      at Test.Object.&lt;anonymous&gt;.Test.assert (../node_modules/supertest/lib/test.js:201:21)
      at Server.localAssert (../node_modules/supertest/lib/test.js:159:12)

A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks.
Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        20.85 s, estimated 29 s
Ran all test suites.

Watch Usage: Press w to show more.
</code></pre>
<p>i notice something here i got 404 status code not found and a different url port not match the backend url i used , so i thing the supertest request to the wrong url and recived {data : &quot;null&quot;} but i didn't know how to fix it .</p>
",https://stackoverflow.com/questions/67428715/nestjs-e2e-testing-graphql-using-supertest-response-error-404,"['api', 'graphql', 'nestjs', 'e2e-testing', 'prisma2']",767,False,1,0
What&#39;s the benefit of E2E testing only against latest browser versions,"<p>When performing end-to-end tests with tools such as Playwright, Puppeteer and Cypress, I believe all of them <em>(<a href=""https://docs.cypress.io/guides/guides/launching-browsers#Launching-by-a-path"" rel=""nofollow noreferrer"">except the latter</a>, pardon me if I'm wrong)</em> only allow you to use the very latest version of each browser which is bundled along with every release.</p>
<p>In that case, I was wondering what would be the real benefit of running your acceptance end-to-end tests which would only validate functionality against a more limited scenario instead of, for example, making sure your application would still work on Chrome 70?</p>
<p>Any insights about why considering only recent browser versions and forgetting about the rest is a good idea, by using Playwright instead of a tool which would allow targeting tests against a specific browser binary, for example and have your E2E testing resulting like:</p>
<pre><code>PASS. Shopping-Cart (Modern)
FAIL. Shopping-Cart (chrome 70) 
// Refactor
</code></pre>
<p>instead of</p>
<pre><code>PASS. Shopping-Cart
// Yay! Release
</code></pre>
",https://stackoverflow.com/questions/67033300/whats-the-benefit-of-e2e-testing-only-against-latest-browser-versions,"['puppeteer', 'cypress', 'e2e-testing', 'playwright']",407,True,5,1
Playwright e2e testing. What to do with oauth2 or email-passwordless authentication,"<p>I am starting to do e2e tests with playwright.
Most of the application requires to be authenticated. Automating this with a username/password mechanism is quite easy. The problem is that the app I want to test has only two authentication mechanisms: Github OAuth and email authentication links. Specifically I am using next-auth in a NextJS project.</p>
<p>I don't know how should I e2e test this with Playwright, the options I have considered are:</p>
<ul>
<li>Completly mocking the authentication using a mock user and a mock session and then append the session token in the test context (as it is described <a href=""https://playwright.dev/docs/auth/#reuse-authentication-state"" rel=""noreferrer"">here</a> in the official docs).</li>
<li>Creating a Github user and/or an email account for the tests and somehow truly use them in playwrigth.</li>
</ul>
<p>The first option is much easier to implement but then it's not e2e testing anymore. The second option looks difficult to implement and I don't know if it is recommended. I don't know if there are smarter or more standarized ways to proceed with this.</p>
",https://stackoverflow.com/questions/69807724/playwright-e2e-testing-what-to-do-with-oauth2-or-email-passwordless-authenticat,"['reactjs', 'next.js', 'e2e-testing', 'playwright', 'next-auth']",2048,True,9,2
How to add cypress-plugin-tab to my Angular e2e testing?,"<p>I am using Angular12, NX, Cypress &amp; KendoUI.
I need to test tabbing through form elements.
How do I add cypress-plugin-tab to my e2e testing?</p>
<p>The guide says use require in the suppport/index.ts file - this is not working for me.</p>
<p>I have executed <code>npm install -D cypress-plugin-tab</code> and added <code>require('cypress-plugin-tab')</code> to suppport/index.ts
I have added this code to my test:</p>
<pre><code>   let password = 'Password';
   let input = cy.focused();
   
   input.type(username).tab().type(password);
</code></pre>
<p>This does not work as it says it cannot find 'tab'.
How do I get 'tab' to work in Angular?
<a href=""https://i.stack.imgur.com/UgTwn.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/UgTwn.png"" alt=""enter image description here"" /></a></p>
",https://stackoverflow.com/questions/68426404/how-to-add-cypress-plugin-tab-to-my-angular-e2e-testing,"['angular', 'cypress', 'angular-e2e', 'nomachine-nx']",661,True,1,1
Cypress E2E Testing VueJS with GitLab Runner returns 404 not found,"<p>I have the following simple GitLab CI file</p>
<pre><code>stages:
  - e2e_test

e2e_test:
  stage: e2e_test
  tags:
    - test
  script:
    - npm config set strict-ssl false
    - npm install
    - npm run test:e2e:ci
</code></pre>
<p>I am running the above script in a shell runner for very specific corporate reasons.</p>
<p>This script results in a 404 error with the following log</p>
<pre><code> npm run test:e2e:ci
&gt; todo-app@0.1.0 test:e2e:ci /home/gitlab-runner/builds/UHz6XzwM/0/microservices-and-cognitive-solutions/demos/microservice-concept/todo-app
&gt; vue-cli-service test:e2e --headless
 INFO  Starting e2e tests...
 INFO  Starting development server...
 DONE  Compiled successfully in 8865ms6:51:36 PM
  App running at:
  - Local:   http://localhost:8083/ 
  - Network: http://10.108.201.150:8083/
  App is served in production mode.
  Note this is for preview or E2E testing only.
====================================================================================================
  (Run Starting)
tput: No value for $TERM and no -T specified
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    3.8.3                                                                              │
  │ Browser:    Electron 78 (headless)                                                             │
  │ Specs:      1 found (test.js)                                                                  │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  test.js                                                                         (1 of 1)
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
  My First Test
    1) Visits the app root url
  0 passing (341ms)
  1 failing
  1) My First Test Visits the app root url:
     CypressError: cy.visit() failed trying to load:
http://localhost:8083/
The response we received from your web server was:
  &gt; 404: Not Found
This was considered a failure because the status code was not '2xx'.
If you do not want status codes to cause failures pass the option: 'failOnStatusCode: false'
      at Object.cypressErr (http://localhost:8083/__cypress/runner/cypress_runner.js:86207:11)
      at Object.throwErr (http://localhost:8083/__cypress/runner/cypress_runner.js:86162:18)
      at Object.throwErrByPath (http://localhost:8083/__cypress/runner/cypress_runner.js:86194:17)
      at http://localhost:8083/__cypress/runner/cypress_runner.js:71493:31
      at visitFailedByErr (http://localhost:8083/__cypress/runner/cypress_runner.js:71006:12)
      at http://localhost:8083/__cypress/runner/cypress_runner.js:71474:22
      at tryCatcher (http://localhost:8083/__cypress/runner/cypress_runner.js:120203:23)
      at Promise._settlePromiseFromHandler (http://localhost:8083/__cypress/runner/cypress_runner.js:118139:31)
      at Promise._settlePromise (http://localhost:8083/__cypress/runner/cypress_runner.js:118196:18)
      at Promise._settlePromise0 (http://localhost:8083/__cypress/runner/cypress_runner.js:118241:10)
      at Promise._settlePromises (http://localhost:8083/__cypress/runner/cypress_runner.js:118316:18)
      at Async../node_modules/bluebird/js/release/async.js.Async._drainQueue (http://localhost:8083/__cypress/runner/cypress_runner.js:114928:16)
      at Async../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:8083/__cypress/runner/cypress_runner.js:114938:10)
      at Async.drainQueues (http://localhost:8083/__cypress/runner/cypress_runner.js:114812:14)

</code></pre>
<p>If I clone the same repository on the same server and manually run the following commands in the terminal it works fine.</p>
<pre><code>npm install
npm run test:e2e:ci
</code></pre>
<p>Any idea why the same commands would fail in a GitLab runner shell but working in a user shell</p>
",https://stackoverflow.com/questions/66806030/cypress-e2e-testing-vuejs-with-gitlab-runner-returns-404-not-found,"['vue.js', 'cypress', 'gitlab-ci-runner']",366,True,-2,1
Nestjs | e2e testing | &quot;smuggle/inject&quot; custom environment variables before ConfigModule triggers validation,"<p>How can I &quot;smuggle&quot; my own testing environment variables into the ConfigModule/ConfigService before the <code>envValidation</code> occurs?
This would be useful to check that:</p>
<ul>
<li>the function <code>envValidation</code> is doing its job correctly;</li>
<li>downstream, the application is behaving according to the variables set.</li>
</ul>
<pre class=""lang-js prettyprint-override""><code>// AppModule.ts


import { validate as envValidate } from './configs/EnvValidation';


@Module({
    imports: [
        TypeOrmModule.forRootAsync({
            imports: [ConfigModule],
            useFactory: (configService: ConfigService) =&gt; ({
                type: configService.get('DATABASE_TYPE'),
                host: configService.get('DATABASE_HOST'),
                port: configService.get&lt;number&gt;('DATABASE_PORT'),
                username: configService.get('DATABASE_USERNAME'),
                password: configService.get('DATABASE_PASSWORD'),
                database: configService.get('DATABASE_NAME'),
                entities: [EntityA, EntityB],
                entityPrefix: &quot;simple_auth_&quot;,
                synchronize: true,
            }  as ConnectionOptions),
            inject: [ConfigService],
        }),
        TypeOrmModule.forFeature([EntityA, EntityB]),
        ConfigModule.forRoot({
            cache: true,
            validate: envValidate
        })
    ],
    controllers: [
        // controllers...
    ],
    providers: [
        // providers...
    ],
})
export class AppModule {}
</code></pre>
<pre class=""lang-js prettyprint-override""><code>// EnvValidation.ts


class EnvironmentVariables {
    @IsIn(['mysql', 'postgres'])
    @IsDefined()
    @IsNotEmpty()
    DATABASE_TYPE: string;

    @IsDefined()
    @IsNotEmpty()
    DATABASE_HOST: string;

    @IsPort()
    @IsDefined()
    @IsNotEmpty()
    DATABASE_PORT: string;

// (...)
}


export function validate(config: Record&lt;string, unknown&gt;) {
    const validatedConfig = plainToClass(EnvironmentVariables, config, {
        enableImplicitConversion: true
    });
    const errors = validateSync(validatedConfig, {
        skipMissingProperties: false
    });

    if (errors.length &gt; 0) {
        const msgs = errors.map((err) =&gt; Object.values(err.constraints)[0]);
        const errorMsg = msgs.join(', ');

        throw new Error(`Error loading environment variables. ${errorMsg}`);
    }

    return validatedConfig;
}
</code></pre>
<pre class=""lang-js prettyprint-override""><code>// e2e-spec.ts



describe('(e2e)', () =&gt; {
    beforeEach(async () =&gt; {});

    afterEach(async () =&gt; {});

    it('should pass while setting: DATABASE_TYPE=postgres, DATABASE_HOST=localhost, ...', async () =&gt; {

        const envVariablesToUse = {
            DATABASE_TYPE: 'postgres',
            DATABASE_HOST: 'localhost',
            // more variables for this test...
        }

        const moduleFixture: TestingModule = await Test.createTestingModule({
            imports: [
                AppModule,
                // ??
            ]
        })
            .overrideModule(ConfigModule)
            .useValue(ConfigModule.forRoot({envVars: envVariablesToUse}))  // &lt;-- Question 1: How to override the environment variables object with a custom one in order to test the rules defined in the EnvironmentVariables class and to test the implications of these configurations downstream?

            .overrideProvider(ConfigService) // &lt;-- Question 2: How to override the ConfigService? May be handy to replace its behaviour(?)
            .useValue(MockConfigService)
            .compile();

        const app = moduleFixture.createNestApplication();

        let successfullyLoadedEnvVariables = true;
        try {
            await app.init();
        }
        catch(err){
            successfullyLoadedEnvVariables = false;
        }

        expect(successfullyLoadedEnvVariables).toBe(true);

        // Then, hit some endpoints to ensure the app is behaving as expected
    });
});
</code></pre>
<p>stackoverflow padding: It looks like your post is mostly code; please add some more details.<br />
stackoverflow padding: It looks like your post is mostly code; please add some more details.</p>
",https://stackoverflow.com/questions/67432760/nestjs-e2e-testing-smuggle-inject-custom-environment-variables-before-conf,"['node.js', 'typescript', 'nestjs']",1630,True,5,1
How to do e2e testing for client side download functionality using cypress?,"<p>I am trying to write e2e test case for download button using cypress.</p>
<ol>
<li>It's a client side download functionality, it'll not hot the backend</li>
<li>When I'll click on download button, it's download the file.</li>
<li>I want assertion like: Once download button is clicked i want to verify the path by checking below downloaded path.</li>
</ol>
<p><a href=""https://i.stack.imgur.com/e8vBO.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/e8vBO.png"" alt=""enter image description here"" /></a></p>
<p><strong>My Code</strong></p>
<pre><code>it('Download button should work', () =&gt; {
        cy.get('.download').click().then(($identifier) =&gt; {
            cy.debug($identifier)
        });
    })
</code></pre>
<p>Can anyone help me how can i get the download path using cypress ?</p>
",https://stackoverflow.com/questions/69375090/how-to-do-e2e-testing-for-client-side-download-functionality-using-cypress,"['node.js', 'testing', 'cypress', 'xlsx', 'e2e-testing']",231,False,0,0
E2E testing a bit confused on what it is suppost to test exactly,"<p>So as title say, I'm a bit confused about the E2E concept. When you search for E2E frameworks you get things like Selenium which can automate your browser. Now what I don't quite get is Some definitions of E2E seems to go way beyond simply using Selenium. So for example consider this test: you can add a user to a group on my website. The test might looks like this:</p>
<pre><code>Start chrome  
Go to mypage.com  
Select the group &quot;abc&quot;  
Click add user  
Enter the users name and click &quot;add&quot;  
Verify that the user was added
</code></pre>
<p>I've seen some places that say that this is an end to end test. But I've also read that it should not end there. For example in this case, let's say the website uses an API to call the backend and the backend adds the user to a database.</p>
<p>So in this case then it's not enough to simply verify that the user experience was correct but we must also go into the database and check that the user was actually added to the correct group. Should this be covered by the same test? Or should there be separate &quot;database tests&quot; for that kind of verification?</p>
",https://stackoverflow.com/questions/66509052/e2e-testing-a-bit-confused-on-what-it-is-suppost-to-test-exactly,"['selenium', 'testing', 'end-to-end']",54,False,0,0
Is it possible to use Cypress for E2E testing when keycloak protectes the site,"<p>I am using Cypress for E2E testing. I also use Keycloak to provide Authentication.</p>
<p>Keycloak uses an external website login form, however, this is not supported by Cypress when it is on a different domain to that being tested.</p>
<p>I know in most cases you would avoid testing the login functionality of 3rd party provider, but in my case, I use the functions built to the Keycloak-js library such as checking for role permissions to validate if a user can access a page.</p>
<p>Without being able to login <strong>through</strong> the keycloak-js adapter, Cypress can not test any of my site.</p>
<p>I am able to login to keycloak via the API using <code>grant_type = password</code> via fetch. This provides me with a token, refresh token and session id. Is there a way I might <strong>init</strong> the keycloak-js adapter with these tokens?</p>
",https://stackoverflow.com/questions/66128342/is-it-possible-to-use-cypress-for-e2e-testing-when-keycloak-protectes-the-site,"['javascript', 'testing', 'single-sign-on', 'keycloak', 'cypress']",591,False,1,0
Chrome Extension e2e testing with nightwatchjs - How to open an URL from within project?,"<p>Im working on an e2e test case using nightwatchjs on my chrome extension project. I have two test cases, the first one finished okay, but the second one which targets a URL opens as an HTTP 404 (not found).</p>
<p>My goal is to open the HTML page within the project so I can run cases using imported functions from other files. Anyone can advise me on how to achieve this?</p>
<p>My code:</p>
<pre><code>describe('Test Extension', function() {
    before(browser =&gt; {
        browser.url('chrome-extension://cnneliealkphmbbcmlhnbfhje/index.html#/menu/configuration')
    });

    it('Test Context menu buttons', function (browser) {
        browser.expect.title().to.equal('Test Extension');
        browser.expect.element('#title').text.to.equal('Test Extension')
        browser.click('#loginButton')
        browser.click('#userName')
        browser.setValue('#userName input', 'testUser')
        browser.click('#userPassword')
        browser.setValue('#userPassword input', 'testPassword')
        browser.click('#signIn')
        browser.pause(5)
        browser.click('#enableSwitch')
        browser.click('#enableSwitch2')
        browser.click('#saveSubmit')
    });

    it('Api test call', function (browser) {
        browser
            .url('http://localhost:9514/test/e2e/specs/test.html')
            .pause()
        browser.expect.element('#caseId').text.to.equal('1000')
        .moveToElement('#caseId')
        .mouseButtonDown(2)
        .mouseButtonUp(2)
        .end();
    });

    after(browser =&gt; browser.end());
});
</code></pre>
<p>The first 'it' case works fine, but the second 'it' case when trying to access the internal html page 'http://localhost:9514/test/e2e/specs/test.html' it fails as 404.</p>
<p>I have tried adding the full path and it still does not work.
Anyone can tell me what I'm missing?
Thank you</p>
",https://stackoverflow.com/questions/67285670/chrome-extension-e2e-testing-with-nightwatchjs-how-to-open-an-url-from-within,"['javascript', 'google-chrome-extension', 'e2e-testing', 'nightwatch.js']",271,False,1,1
E2E Testing a frontend and mock a request the backend is making with Cypress,"<p>Currently when creating a customer during an e2e testcase, my stripe-like payment gateway says &quot;Customer already exists&quot; which is true because this testcase has been run once already.</p>
<p>What is the high level solution? If it would be a unit test, I think mocking the payment-provider request would be the way to go. But in this case I can only intercept the requests that go from my frontend, right? I could mock away the whole request to my backend but that's not the point of e2e testing I think.</p>
<p>I also thought about some sort of flag or environment variable so that the backend knows if it's currently e2e tested (and in this case behave differently, eg not make this specific request). But I think that's not good practice.</p>
",https://stackoverflow.com/questions/66642867/e2e-testing-a-frontend-and-mock-a-request-the-backend-is-making-with-cypress,"['testing', 'mocking', 'cypress', 'e2e-testing']",272,False,0,1
"Cypress e2e testing of a project, Enable or disable a it block dependent on condition","<p>Suppose I have the following spec containing 2 <strong>it</strong> blocks, one checks the menu items for teacher role, and another one checks for student role. The variable <strong>rolesToCheck</strong> contains the roles on which basis <strong>it</strong> block will be activated, Currently, the <strong>rolesToCheck</strong> variable only contains the student hence it will run only the second <strong>it</strong> block. Is it possible to do so?</p>
<pre><code>   describe('side menu check', () =&gt; {
    var sideMenuHelper;
    var rolesToCheck = ['student'];
    beforeEach(() =&gt; {
        cy.login();
        cy.wait(5000);
    });

    it('menu item check for teacher', () =&gt; {
        .....
    })

    it('menu item check for student', () =&gt; {
        .....
    })

})
</code></pre>
",https://stackoverflow.com/questions/67411619/cypress-e2e-testing-of-a-project-enable-or-disable-a-it-block-dependent-on-cond,"['testing', 'cypress', 'e2e']",674,True,1,3
e2e testing in Angular: uploading and downloading a file doesn&#39;t work using protractor in firefox,"<p>First I should point out that we are running the web app using docker.</p>
<p>I get a prompt when I download a file using protractor in Firefox that prevents me from downloading so I'm trying to disable the download prompt by modifying the <code>protractor.conf.js</code> file (code below)</p>
<p>When I try to upload a file using Firefox in headless mode I get an error <code>Failed: Failed to decode response from marionette</code> but it works fine if I disable headless mode.</p>
<p>It's required from me to use Firefox and headless mode with this test, I've tried running the tests with chrome and it worked, the issue only happens when using Firefox.
Can someone please provide me with help here?</p>
<p>PS: I've looked into other similar questions but solutions are outdated (angularjs) and they didn't work for me.</p>
<p>Protractor.conf.js</p>
<pre><code>exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './e2e/**/*.e2e-spec.ts'
  ],
  capabilities: 
    // { browserName: 'chrome',
    //   chromeOptions: {
    //     args: ['--headless', &quot;--disable-gpu&quot;, '--no-sandbox'],
    //     // prefs: {
    //     //     'download': {
    //     //         prompt_for_download: false,
    //     //         // 'directory_upgrade': true,
    //     //         // 'default_directory': '/home/houssem/Desktop'
    //     //     }
    //     // }
    //   }
    // },
    { browserName: 'firefox',
      marionette: true,
      acceptInsecureCerts: true,
      'moz:firefoxOptions': {
       args: [ &quot;--headless&quot; ],
        prefs: {
          'pdfjs.disabled': true,
          'browser.download.folderList' : 0,
          'browser.download.dir' : process.cwd() + &quot;/Desktop&quot;,
          'browser.download.panel.shown': false,
          'browser.download.useDownloadDir': true,
          'browser.download.manager.useWindow': false,
          'browser.helperApps.alwaysAsk.force': false,
          'browser.helperApps.neverAsk.openFile': true,
          'browser.download.manager.closeWhenDone': false,
          'browser.download.manager.alertOnEXEOpen': false,
          'browser.download.manager.showWhenStarting': false,
          'browser.download.manager.focusWhenStarting': false,
          'browser.download.manager.showAlertOnComplete': false,
          'browser.helperApps.neverAsk.saveToDisk' : 'image/svg+xml,image/vnd.dxf,image/png,image/x-citrix-png,image/x-png', 
        },
      },
    },
  
  directConnect: true,
  baseUrl: 'http://localhost:4200/',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    print: function() {}
  },
</code></pre>
<p>app.e2e-spec.ts</p>
<pre><code>it('Testing upload button', () =&gt; {      
        page.navigateTo('/rules');
        var path = require('path');
        var fileToUpload = '../../tests/rules/rule-regex.json';
        var absolutePath = path.resolve(__dirname, fileToUpload);
        page.upload(absolutePath);
  });


  it('Testing download button', () =&gt; {      
        page.navigateTo('/nodeSymbols');
        page.download();
  });
</code></pre>
<p>app.po.ts</p>
<pre><code> upload(file){
    element(by.css('.controlPanel .batchUpload')).click();
    element(by.css('#batchUploadInput')).sendKeys(file);
  }

  download(){
    for (let i = 0; i &lt; 6; i++) {
      element(by.css('.controlPanel .download')).click();
      element.all(by.css('#downloadMenu .downloadOption')).get(i).click();
    }
  }
</code></pre>
",https://stackoverflow.com/questions/65547033/e2e-testing-in-angular-uploading-and-downloading-a-file-doesnt-work-using-prot,"['angular', 'firefox', 'protractor', 'e2e-testing']",251,False,0,1
Is there a way I can find an element in a FlatList using Detox E2E testing,"<p>So while testing my application, I am using a data set. Since the data set has many entries, I am using FlatList to display my list. After creating the list, I want to be able to verify and tap on certain list items. Below, I have attached the code which I am trying to use and it does not work for me. If anyone has a better idea to do this, please let me know.</p>
<p>The approach I think should be taken. I can't think of anything else to make the FlatList scroll and find the item I am looking for.</p>
<pre><code>let isNotFound = true;
while (isNotFound) {
   try {
       await waitFor(element(by.id((edit_details.index).toString()))).toBeVisible().withTimeout(2000)
       isNotFound = false;
   } catch (e) {
       await element(by.id('credit_history_list')).swipe('up', 'slow', 0.2)
   }
}
await element(by.id((edit_details.index).toString())).tap();

</code></pre>
<p>It does help scroll the list and it keeps scrolling while it actually finds the entry I am looking for. But the .tap() function does not work. Instead, detox moves on with the next line of code.</p>
<p>Is there a better way to do this?</p>
<p>Thanks in advance!</p>
",https://stackoverflow.com/questions/67218504/is-there-a-way-i-can-find-an-element-in-a-flatlist-using-detox-e2e-testing,"['react-native', 'testing', 'jestjs', 'mocha.js', 'detox']",1747,True,1,1
NestJS + Fastify e2e testing: Jest did not exit one second after the test run has completed,"<p>While running end-to-end tests of NestJS+Fastify application I noticed the following warnings:</p>
<blockquote>
<p>Jest did not exit one second after the test run has completed.</p>
</blockquote>
<blockquote>
<p>This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with <code>--detectOpenHandles</code> to troubleshoot this issue.</p>
</blockquote>
<p>My code follows the docs:
<a href=""https://i.stack.imgur.com/kN2b8.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/kN2b8.png"" alt=""enter image description here"" /></a></p>
<p>When adding the <code>--detectOpenHandles</code> option I saw the following:</p>
<pre><code> FAIL  test/app.e2e-spec.ts
  AppController (e2e)
    ✕ /GET cats (975 ms)

  ● AppController (e2e) › /GET cats

    expect(received).toEqual(expected) // deep equality

    Expected: 200
    Received: 404

      23 |       })
      24 |       .then((result) =&gt; {
    &gt; 25 |         expect(result.statusCode).toEqual(200);
         |                                   ^
      26 |         expect(result.payload).toEqual('API is running.');
      27 |       });
      28 |   });

      at app.e2e-spec.ts:25:35

</code></pre>
<p>So what's the problem?</p>
",https://stackoverflow.com/questions/70041560/nestjs-fastify-e2e-testing-jest-did-not-exit-one-second-after-the-test-run-ha,"['jestjs', 'nestjs', 'e2e-testing', 'fastify', 'nestjs-fastify']",658,False,0,1
How to use Cypress.io for E2E testing when back end and front end are in separate repos?,"<p>I have a project with a NextJS front end and a FeathersJS/Node back end. Both of these apps/codebases are separate repos. I would like to start using Cypress for E2E testing, but I'm not sure what the best approach is to do that with my set up. Ideally, the tests would run as part of CI for every back end AND front end change. I am currently using GitHub actions for my CI, I'm not sure if that would help or hurt me here.</p>
<p>I've seen some people mention putting Cypress in its own repo with its own docker-compose that would handle spinning up the front end and back end to run the tests. However, I don't understand how this would work as part of CI. How would new code, pre-merge, make its way into this repo to run as part of CI? I think there would be a lot of issues with this approach.</p>
<p>One approach I thought of is to just include Cypress as part of the front end NextJS app and have it run against a &quot;staging&quot; or &quot;test&quot; instance of the back end that gets seeded with every new back end deploy. One of the issues here is that the tests would not run when the back end changes, but that's not necessarily an issue, I suppose.</p>
<p>Any thoughts?</p>
",https://stackoverflow.com/questions/67131004/how-to-use-cypress-io-for-e2e-testing-when-back-end-and-front-end-are-in-separat,"['node.js', 'testing', 'next.js', 'devops', 'cypress']",551,False,5,0
Nestjs e2e testing of an application within a monorepo fails to resolve @app import from library with jest despite config in package.json,"<p>I'm trying to run e2e tests for a monorepo application that also utilises several libraries from within the monorepo, all imports throughout the application are resolved using &quot;@app&quot; imports, for example <code>import { ConfigService } from &quot;@app/config&quot;</code></p>
<p>However, when trying to run e2e tests via the command:</p>
<pre><code>&quot;test:public&quot;: &quot;jest --config ./apps/public-microservice/test/jest-e2e.json&quot;,
</code></pre>
<p>Jest throws:</p>
<pre><code> Cannot find module '@app/config' from '../src/public-microservice.module.ts'
</code></pre>
<p>I've looked at <a href=""https://github.com/jmcdo29/testing-nestjs"" rel=""noreferrer"">this demo-repo from @jmcdo29</a> and can't find anything that is different with my configuration.</p>
<p>I've noticed there was an issue about wrong configurations being generated via jest <a href=""https://github.com/nestjs/nest-cli/issues/465"" rel=""noreferrer"">here in 2019</a>, but it has long been resolved, and my configuration for jest in package.json does indeed mention:</p>
<pre><code>    &quot;moduleNameMapper&quot;: {
      &quot;@app/config/(.*)&quot;: &quot;&lt;rootDir&gt;/libs/config/src/$1&quot;,
      &quot;@app/config&quot;: &quot;&lt;rootDir&gt;/libs/config/src&quot;,
</code></pre>
<p>whilst the local targeted file by the package.json script command only contains:</p>
<pre><code>{
  &quot;moduleFileExtensions&quot;: [&quot;js&quot;, &quot;json&quot;, &quot;ts&quot;],
  &quot;rootDir&quot;: &quot;.&quot;,
  &quot;testEnvironment&quot;: &quot;node&quot;,
  &quot;testRegex&quot;: &quot;.e2e-spec.ts$&quot;,
  &quot;transform&quot;: {
    &quot;^.+\\.(t|j)s$&quot;: &quot;ts-jest&quot;
  }
}

</code></pre>
<p>Is there something that's missing from my command or my configuration?</p>
<p>Is there anything I need to specify to tell jest to extend the configuration for jest available in package.json?</p>
<p>Any help investingating this is appreciated, thanks.</p>
",https://stackoverflow.com/questions/66956387/nestjs-e2e-testing-of-an-application-within-a-monorepo-fails-to-resolve-app-imp,"['jestjs', 'nestjs', 'nestjs-testing']",1737,True,5,1
Css-selector is not able to identify element in WEBVIEW in iOS hybrid app(build in Ionic+angular) while doing e2e testing using Appium,"<p>I am doing e2e testing on iPhone 11 (real device) for a hybrid app built using ionic +angular and using CSS-selector to click/tap elements. It can not identify the text field even though it is available in the webview. I also tried to access the text field via XPATH but it did not work either.</p>
<p>Angular: 10.1.5
Angular CLI: 10.1.6
Node: 14.15.4
typescript: 4.0.3
ionic : 5.2.3
appium : 1.20.2</p>
<p>I also read this thread: <a href=""https://discuss.appium.io/t/not-able-to-identify-element-in-webview-in-ios-hyprid-app-build-in-ionic-automation-using-appium-on-real-device/10244/8"" rel=""nofollow noreferrer"">https://discuss.appium.io/t/not-able-to-identify-element-in-webview-in-ios-hyprid-app-build-in-ionic-automation-using-appium-on-real-device/10244/8</a></p>
<p>Until now, it was not able to identify.
Please let me know if anyone of you has any leads regarding this issue.</p>
<p>Thanks</p>
<p>Sukriti</p>
",https://stackoverflow.com/questions/66419421/css-selector-is-not-able-to-identify-element-in-webview-in-ios-hybrid-appbuild,"['angular', 'ionic-framework', 'automated-tests', 'appium', 'hybrid-mobile-app']",178,False,1,0
Are there any tools for unit testing VodaPay Mini-Programs?,"<p>What are, if any, the testing tools used for test automation when you develop mini-programs on the VodaPay Mini-Program platform? I'm looking specifically to do Unit and E2E testing.</p>
",https://stackoverflow.com/questions/68152326/are-there-any-tools-for-unit-testing-vodapay-mini-programs,['vodapay-miniprogram'],262,True,0,3
How to run a script on a service container in Gitlab CI,"<p>I'm doing e2e testing using Cypress in Gitlab CI. I imported database and backend as services. Now I need to run an npm script on backend to populate the db. How do I do that?</p>
<p><div class=""snippet"" data-lang=""js"" data-hide=""false"" data-console=""true"" data-babel=""false"">
<div class=""snippet-code"">
<pre class=""snippet-code-js lang-js prettyprint-override""><code>.docker: &amp;docker
  tags:
    - docker
    
t:test-server-mr:
  stage: test
  allow_failure: true
  before_script:
    - echo ""Skipping global before script""
  image: node:12.16.1-stretch
  services:
    - name: registry.gitlab.com/registryname/backend/db:latest
      alias: database
    - name: registry.gitlab.com/registryname/backend/master
      alias: backend
  script:
    - npm install
    - npm run ci
  &lt;&lt;: [*docker]</code></pre>
</div>
</div>
</p>
",https://stackoverflow.com/questions/70424041/how-to-run-a-script-on-a-service-container-in-gitlab-ci,['gitlab-ci'],184,False,1,1
Cypress Testing Library as open source,"<p>I should be starting testing react soon, I am more focused on integration and e2e testing as unit testing will be done by developers. However we would like to respect some homogeneity in our react testing tool-kit. I am only interested into open source tools. I know that cypress is a good candidate for e2e testing however it's not open source. My question is is it possible to use cypress as a testing library instead : <a href=""https://testing-library.com/docs/cypress-testing-library/intro"" rel=""nofollow noreferrer"">https://testing-library.com/docs/cypress-testing-library/intro</a> and will it have any limitation compared to using cypress? Which runner would you recommend and will i need to bundle any other tool with the library?</p>
",https://stackoverflow.com/questions/67466934/cypress-testing-library-as-open-source,"['reactjs', 'cypress', 'e2e-testing']",97,True,-2,1
Dispatching action from custom command or plugin using Cypress,"<p>I am using cypress for E2E testing of my angular web application.</p>
<p>I can able to dispatch the action from the test file as below,</p>
<pre><code> describe('Views', () =&gt; {
    it('Will update the token', () =&gt; {
      cy.window().its('store').invoke('dispatch', { payload: 'abcdefgh', type: 'UPDATE_TOKEN' });
    });
  });
</code></pre>
<p><strong>Issue is</strong></p>
<p>but I couldn't use the same from the custom command or Plugin</p>
<pre><code>Cypress.Commands.add('login', () =&gt; {
  
        cy.request({
          method: 'POST',
          url: `${apiUrl}/v1/verify_otp`,
          body: {
            user: {
              email: Cypress.env('userName'),
              otp: '1234'// As of dev, any OTP will work here
            },
          },
        }).then((res) =&gt; {

          cy.window().its('store').invoke('dispatch', { payload: 'abcd', type: 'UPDATE_TOKEN' });
         
        });
      });

</code></pre>
",https://stackoverflow.com/questions/68631400/dispatching-action-from-custom-command-or-plugin-using-cypress,['cypress'],225,True,1,1
How to implement e2e testing in Nest JS Framework,"<p>I am new this Framework. I implemented crud operation, migration, unit testing also but I do know how to implement e2e testing in nest JS Framework. I tried to run the e2e testing program it's throwing an error
How to fix this error. I tried many ways but I could not get the solution
<a href=""https://i.stack.imgur.com/5hjwa.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/5hjwa.png"" alt=""enter image description here"" /></a>It showing this error <strong>No repository for &quot;UserEntity&quot; was found. Looks like this entity is not registered in current &quot;default&quot; connection?</strong>. So, I tried to change my database configuration</p>
<p><strong>Database configuration</strong></p>
<pre><code>{
              type: 'postgres',
              host:  process.env[`${process.env.NODE_ENV}_POSTGRES_HOST`],
              port: parseInt(process.env[`${process.env.NODE_ENV}_POSTGRES_PORT`]) || 5432,
              username: process.env[`${process.env.NODE_ENV}_POSTGRES_USER`],
              password: process.env[`${process.env.NODE_ENV}_POSTGRES_PASSWORD`],
              database: process.env[`${process.env.NODE_ENV}_POSTGRES_DATABASE`],
              entities: [&quot;dist/**/*.entity{ .ts,.js}&quot;],
              migrations: [&quot;dist/database/migration/*.js&quot;],
              cli:{
                  migrationsDir: 'src/database/migration',
                  }
            }
</code></pre>
<p>This problem is occurred in the <strong>entities column</strong> in the database configuration. If I change the entities directory the application cannot run. how to fix this issue</p>
<p><strong>tsconfig.json</strong></p>
<pre><code>{
  &quot;compilerOptions&quot;: {
    &quot;module&quot;: &quot;commonjs&quot;,
    &quot;declaration&quot;: true,
    &quot;removeComments&quot;: true,
    &quot;emitDecoratorMetadata&quot;: true,
    &quot;experimentalDecorators&quot;: true,
    &quot;allowSyntheticDefaultImports&quot;: true,
    &quot;target&quot;: &quot;es2017&quot;,
    &quot;sourceMap&quot;: true,
    &quot;outDir&quot;: &quot;./dist&quot;,
    &quot;baseUrl&quot;: &quot;./&quot;,
    &quot;incremental&quot;: true
  }
}
</code></pre>
",https://stackoverflow.com/questions/66988418/how-to-implement-e2e-testing-in-nest-js-framework,"['node.js', 'nestjs', 'nestjs-swagger', 'nestjs-config', 'nestjs-passport']",6361,True,1,1
What the webpack is complaining about?,"<p>I'm using Cypress for e2e testing.
Within Gitlab CI I'm getting this error from the webpack:</p>
<pre><code>Oops...we found an error preparing this test file:
  cypress/integration/node_modules/randomstring/node_modules/randombytes/test.js
The error was:
Error: Webpack Compilation Error
./cypress/integration/node_modules/randomstring/node_modules/randombytes/test.js
Module not found: Error: Can't resolve 'tape' in '/e2e/cypress/integration/node_modules/randomstring/node_modules/randombytes'
resolve 'tape' in '/e2e/cypress/integration/node_modules/randomstring/node_modules/randombytes'
  Parsed request is a module
  using description file: /e2e/cypress/integration/node_modules/randomstring/node_modules/randombytes/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    Looked for and couldn't find the file at the following paths:
[/e2e/cypress/integration/node_modules/randomstring/node_modules/randombytes/node_modules]
[/e2e/cypress/integration/node_modules/randomstring/node_modules/node_modules]
[/e2e/cypress/integration/node_modules/node_modules]
[/e2e/cypress/node_modules]
[/e2e/node_modules]
[/node_modules]
[/e2e/cypress/integration/node_modules/package.json]
[/e2e/cypress/integration/node_modules/randomstring/node_modules/tape]
[/e2e/cypress/integration/node_modules/randomstring/node_modules/tape.js]
[/e2e/cypress/integration/node_modules/randomstring/node_modules/tape.json]
[/e2e/cypress/integration/node_modules/tape/package.json]
[/e2e/cypress/integration/node_modules/randomstring/node_modules/tape.jsx]
[/e2e/cypress/integration/node_modules/tape]
[/e2e/cypress/integration/node_modules/randomstring/node_modules/tape.mjs]
[/e2e/cypress/integration/node_modules/tape.js]
[/e2e/cypress/integration/node_modules/randomstring/node_modules/tape.coffee]
[/e2e/cypress/integration/node_modules/tape.json]
[/e2e/cypress/integration/node_modules/tape.jsx]
[/e2e/cypress/integration/node_modules/tape.mjs]
[/e2e/cypress/integration/node_modules/tape.coffee]
</code></pre>
<p>the output speaks about not being able to resolve 'tape' in the <code>randomstring</code> package.</p>
<p>What can I do about this ? This is a compilation error.</p>
",https://stackoverflow.com/questions/70294448/what-the-webpack-is-complaining-about,"['node.js', 'npm', 'webpack', 'cypress', 'gitlab-ci-runner']",110,False,2,0
Unable to start e2e tesing in angular project,"<p>Running e2e testing on my angular project throws.</p>
<p>My chrome version : Version 87.0.4280.141 (Official Build) (x86_64)</p>
<p>I have enabled auto-update in my chrome browser. Seems like the issue occurs after the browser update.</p>
<pre><code>ng e2e
</code></pre>
<p><div class=""snippet"" data-lang=""js"" data-hide=""false"" data-console=""true"" data-babel=""false"">
<div class=""snippet-code"">
<pre class=""snippet-code-js lang-js prettyprint-override""><code>Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'myhost', ip: 'myip', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '15.0.1'
Driver info: driver.version: unknown
[17:00:29] E/launcher - WebDriverError: Timed out waiting for driver server to start.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'myhost', ip: 'myip', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '15.0.1'
Driver info: driver.version: unknown
    at Object.checkLegacyResponse (my-project/node_modules/selenium-webdriver/lib/error.js:546:15)
    at parseHttpResponse (my-project/node_modules/selenium-webdriver/lib/http.js:509:13)
    at my-project/node_modules/selenium-webdriver/lib/http.js:441:30
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
From: Task: WebDriver.createSession()
    at Function.createSession (my-project/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (my-project/node_modules/selenium-webdriver/chrome.js:761:15)
    at createDriver (my-project/node_modules/selenium-webdriver/index.js:170:33)
    at Builder.build (my-project/node_modules/selenium-webdriver/index.js:626:16)
    at Local.getNewDriver (my-project/node_modules/protractor/built/driverProviders/driverProvider.js:53:33)
    at Runner.createBrowser (my-project/node_modules/protractor/built/runner.js:195:43)
    at my-project/node_modules/protractor/built/runner.js:339:29
    at _fulfilled (my-project/node_modules/q/q.js:834:54)
    at my-project/node_modules/q/q.js:863:30
    at Promise.promise.promiseDispatch (my-project/node_modules/q/q.js:796:13)
[17:00:29] E/launcher - Process exited with error code 199</code></pre>
</div>
</div>
</p>
<p>my protractor config file.</p>
<p><div class=""snippet"" data-lang=""js"" data-hide=""false"" data-console=""true"" data-babel=""false"">
<div class=""snippet-code"">
<pre class=""snippet-code-js lang-js prettyprint-override""><code>const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './e2e/**/*.e2e-spec.ts'
  ],
  capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
      args: [ ""--no-sandbox"", ""--headless"", ""--disable-gpu"", ""--window-size=1600,900"" ]
    }
  },
  baseUrl: 'http://localhost:4200/',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    print: function() {}
  },
  onPrepare() {
    require('ts-node').register({
      project: 'e2e/tsconfig.e2e.json'
    });
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
  }
};</code></pre>
</div>
</div>
</p>
<p>Please help.</p>
",https://stackoverflow.com/questions/65628312/unable-to-start-e2e-tesing-in-angular-project,"['angular', 'selenium', 'selenium-webdriver', 'protractor', 'e2e-testing']",475,True,1,2
How to know if chrome is invoked by cypress,"<p>I'm new to Cypress.
I want to set some sample data for e2e testing in application cache only when chrome is invoked by Cypress. Else, normal flow will work.
Is there any way to know if Chrome is invoked by Cypress or not?</p>
",https://stackoverflow.com/questions/66311028/how-to-know-if-chrome-is-invoked-by-cypress,"['javascript', 'cypress']",131,True,0,2
Trouble-shooting &quot;Cannot use import statement outside a module&quot;,"<p>I am trying to use puppeteer for e2e testing on a react app. I'd prefer to use TypeScript, so I've tried to start with a file that begins with:</p>
<pre><code>import puppeteer, { Browser, Page } from &quot;puppeteer&quot;;
</code></pre>
<p>I can't seem to resolve this error, though:</p>
<pre><code>({&quot;Object.&lt;anonymous&gt;&quot;:function(module,exports,require,__dirname,__filename,global,jest){import puppeteer from &quot;puppeteer&quot;;
                                                                                         ^^^^^^

SyntaxError: Cannot use import statement outside a module

  at Runtime.createScriptFromCode (../node_modules/jest-runtime/build/index.js:1350:14)
</code></pre>
<p>I'm eager to learn, but not sure how to trouble-shoot this.</p>
",https://stackoverflow.com/questions/66876438/trouble-shooting-cannot-use-import-statement-outside-a-module,"['reactjs', 'jestjs', 'ts-jest', 'jest-puppeteer']",326,False,0,1
How to override an imported module in nestjs testing?,"<p>I'm quite new on <code>nestjs</code>, met an issue regarding how to override the <code>load</code> function of <code>ConfigModule</code>, hope someone can help me out, thanks in advance!</p>
<p>My e2e testing:</p>
<pre class=""lang-js prettyprint-override""><code>const moduleForTesting = await Test.createTestingModule({imports: [AppModule]});
</code></pre>
<p>My App Module:</p>
<pre class=""lang-js prettyprint-override""><code>import config from './config/index'

@Module({
  imports: [ConfigModule.forRoot({isGlobal: true, load: [config]})]
})
</code></pre>
<p>My <code>config/index</code> file:</p>
<pre class=""lang-js prettyprint-override""><code>export default async () =&gt; {
  someConfigs: ...
}
</code></pre>
<p>Now I want the e2e testings use another configurations, but I don't know how to override the AppModule, nor the <code>load</code> function:</p>
<pre class=""lang-js prettyprint-override""><code>// AppModule
import config from './config/index' // This is ok for production, but need to be overridden in testing

...
  imports: [ConfigModule.forRoot({isGlobal: true, load: [config]})]
</code></pre>
",https://stackoverflow.com/questions/67194776/how-to-override-an-imported-module-in-nestjs-testing,"['typescript', 'nestjs', 'nestjs-config']",3939,True,4,3
yarn serve in background,"<p>I'm trying to configure gitlab CI/CD for cypress e2e testing on my vue app which uses yarn for package management. cypress documents are all written for npm <a href=""https://docs.cypress.io/guides/continuous-integration/gitlab-ci"" rel=""nofollow noreferrer"">cypress gitlab ci/cd configuration tutorial</a></p>
<pre><code># start the server in the background
- npm run start:ci &amp;
# run Cypress tests
- npx cypress run --browser firefox
</code></pre>
<p>is there a way to start server in background for yarn? like running yarn serve but in background.</p>
",https://stackoverflow.com/questions/69130734/yarn-serve-in-background,"['vue.js', 'npm', 'cypress', 'yarnpkg']",1434,True,3,1
NestJS createTestingModule and getHttpServer() error 503,"<p>I'm using NestJS 7.6.0 and I'm experiencing a problem with E2E testing.</p>
<p>I have a very simple module that exposes a /health route in its controller. I'd like to test this route using the E2E testing feature of nestJs documented here:</p>
<p><a href=""https://docs.nestjs.com/fundamentals/testing#end-to-end-testing"" rel=""nofollow noreferrer"">https://docs.nestjs.com/fundamentals/testing#end-to-end-testing</a></p>
<p>I'm currently using the quite same code:</p>
<pre class=""lang-js prettyprint-override""><code>
describe('AppController (e2e)', () =&gt; {

    let app: INestApplication;
    beforeAll(async () =&gt; {
        const moduleFixture: TestingModule = await Test.createTestingModule({     
            imports: [AppModule]
        }).compile();

        app = moduleFixture.createNestApplication();
        await app.init();
    }); 

    it('/health (GET)', async() =&gt; {
        return await request(app.getHttpServer())
            .get('/health')
            .expect(200)
    });
});

</code></pre>
<p>If I run this test with <code>npm run test</code> I have this error:</p>
<pre><code>npm run test

&gt; dv-ewok-api@0.0.1 test ....
&gt; jest

[Nest] 54638   - 28/06/2021, 14:53:30   [ExceptionHandler] Health Check has failed! {&quot;ready&quot;:{&quot;status&quot;:&quot;down&quot;,&quot;message&quot;:&quot;connect ECONNREFUSED 127.0.0.1:3000&quot;}}
 FAIL  src/health/health.controller.spec.ts
  ● AppController (e2e) › /health (GET)

    expected 200 &quot;OK&quot;, got 503 &quot;Service Unavailable&quot;

  32 |         return await request(app.getHttpServer())
  33 |             .get('/health')
&gt; 34 |             .expect(200)
     |              ^
  35 |
  36 |     });
  37 | });

</code></pre>
<p>It seems that the httpServer is not running.</p>
<p>To make it work I have to modify the code like this:</p>
<pre class=""lang-js prettyprint-override""><code>...
beforeAll(async () =&gt; {
        const moduleFixture: TestingModule = await Test.createTestingModule({     
            imports: [AppModule]
        }).compile();

        app = moduleFixture.createNestApplication();
        await app.init();
        await app.listen(3000); // &lt;===== ADD THIS LINE
    }); 
...
</code></pre>
<p>I just added a <code>app.listen(3000)</code> and the test passed. I don't know if this is an oversight in the documentation or if I did it wrong.</p>
<p>Thank you for your help.</p>
<h2>Edit for adding some more details</h2>
<p>For the HealthCheck part, I'am using the NestJS Terminus integration <a href=""https://docs.nestjs.com/recipes/terminus"" rel=""nofollow noreferrer"">described here</a>.</p>
<p>So, my app.module looks like this :</p>
<pre class=""lang-js prettyprint-override""><code>import { Module } from '@nestjs/common';
import { TerminusModule } from '@nestjs/terminus';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { HealthController } from './health/health.controller';

@Module({
  imports: [TerminusModule],
  controllers: [AppController, HealthController],
  providers: [AppService],
})
export class AppModule {}

</code></pre>
<p>As you can see, I import the TerminusModule and I declare my 2 controllers: AppController and HealthController.</p>
<p>In <strong>AppController</strong> I have just a /ping route that says &quot;hello world&quot;</p>
<pre class=""lang-js prettyprint-override""><code>import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get('/ping')
  getHello(): string {
    return this.appService.getHello();
  }
}

</code></pre>
<p>And in <strong>HealthController</strong> I have just the /health route that calls the /ping on localhost.</p>
<pre class=""lang-js prettyprint-override""><code>import { Controller, Get } from &quot;@nestjs/common&quot;;
import { HealthCheck, HealthCheckService, HttpHealthIndicator } from &quot;@nestjs/terminus&quot;;

@Controller('health')
export class HealthController {
  constructor(
    private health: HealthCheckService,
    private http: HttpHealthIndicator,
  ) {}

  @Get()
  @HealthCheck()
  check() {
    return this.health.check([
      () =&gt; this.http.pingCheck('ping', 'http://localhost:3000/ping'),
    ]);
  }
}

</code></pre>
<p>And if you run tests with <code>npm run test</code>, it shows the 503 error linked above. To make it work, I need to add <code>await app.listen(3000);</code> in the beforeAll() method right after the init() (cf. above).</p>
<p>I think my problem comes from &quot;terminus&quot; because if I start a new NestJS project which does not use Terminus, e2e testing works fine, without the need to add the .listen().</p>
<p>Do I need to do something special in the createTestingModule() with TerminusModule?</p>
<p>Thank you</p>
",https://stackoverflow.com/questions/68164554/nestjs-createtestingmodule-and-gethttpserver-error-503,"['unit-testing', 'nestjs', 'e2e-testing']",1640,False,4,0
Effectiveness of end-to-end testing when microservices have independent release schedules?,"<p>I'm part of a 20 odd group of developers who maintain around 7 components (websites and microservices) for a single domain in our company (e.g. delivery tracking domain).</p>
<p>In order to ensure quality, we have a &quot;domain scoped end to end tests&quot;. Our E2E testing however has one problem: our E2E environment can have a component that's on a version that's different from production. The reason for this disparity is the components (e.g. microservice) have their own release schedules.</p>
<p>How do you handle this problem? <a href=""https://stackoverflow.com/questions/44043159/how-do-i-include-end-to-end-tests-across-microservices-into-multiple-continuous?rq=1"">My question is almost similar to this</a></p>
<p>Do you enforce that E2E must be run on the correct microservice versions? If so how?</p>
<p>Or do you accepted the fact that CI and production will never have identical microservice versions and just rely on monitoring production?</p>
<p>Lastly, how important is E2E in your CI/CD pipeline?</p>
<p>Note that I'm only interested in E2E testing of our microservices since it's impossible for me to control when a 3rd party service gets released.</p>
<p>Thanks</p>
",https://stackoverflow.com/questions/70402026/effectiveness-of-end-to-end-testing-when-microservices-have-independent-release,"['testing', 'continuous-integration', 'microservices', 'devops', 'continuous-delivery']",304,True,0,1
How to implement the autotesting stage in GitLab CI using CodeceptJS?,"<p>I am trying to configure the startup stage of autotests in the GitLab CI pipeline according to the example:</p>
<p><a href=""https://codecept.discourse.group/t/codeceptjs-gitlab-integration/427"" rel=""nofollow noreferrer"">CodeceptJS GitLab Integration</a></p>
<p>Step to reproduce:</p>
<ol>
<li>I cloned this repository <a href=""https://gitlab.com/paulvincent/codeceptjs-e2e-testing"" rel=""nofollow noreferrer"">https://gitlab.com/paulvincent/codeceptjs-e2e-testing</a></li>
</ol>
<pre><code>git@gitlab.com:paulvincent/codeceptjs-e2e-testing.git
</code></pre>
<ol start=""2"">
<li>added changes and make a push</li>
</ol>
<p>As a result, the Job filed with error</p>
<p><a href=""https://i.stack.imgur.com/t4dkP.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/t4dkP.png"" alt=""enter image description here"" /></a></p>
<p><a href=""https://i.stack.imgur.com/RCfBT.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/RCfBT.png"" alt=""enter image description here"" /></a></p>
<p>If someone has set up CodeceptJS + Gitlab CI, please share the config <strong>.gitlab-ci.yml</strong></p>
",https://stackoverflow.com/questions/69338484/how-to-implement-the-autotesting-stage-in-gitlab-ci-using-codeceptjs,"['gitlab-ci', 'codeceptjs']",248,True,0,1
Browserstack custom reporter Cypress config,"<p>I'm using Cypress to run my e2e testing on Browserstack. I'm using <code>junit</code> reporter which is configured in the <code>cypress.json</code>. When I'm running tests locally test results are generated according to the format (i.e <code>junit</code>). However, when I'm running testing in Browserstack and fetch the results, they are not following the cypress config and are returned as mocha files.</p>
<p>Have anyone managed to make Browserstack return test results in <code>junit</code> format? Configs:</p>
<pre><code> cypress.json

{
  &quot;reporter&quot;: &quot;junit&quot;,
  &quot;reporterOptions&quot;: {
    &quot;mochaFile&quot;: &quot;results/test-output-[hash].xml&quot;,
    &quot;toConsole&quot;: true,
    &quot;attachments&quot;: true
  }
}


  browserstack.json

{
    &quot;auth&quot;: {...},
    &quot;browsers&quot;: [...],

    &quot;run_settings&quot;: {
      &quot;cypress_config_file&quot;: &quot;./cypress.json&quot;,
      &quot;cypress_version&quot;: &quot;6&quot;,
      &quot;project_name&quot;: &quot;FancyProjectName&quot;,
      &quot;build_name&quot;: &quot;Build no. 42&quot;,
      &quot;parallels&quot;: &quot;2&quot;,
      &quot;npm_dependencies&quot;: {
        &quot;typescript&quot;: &quot;^4.2.4&quot;
      }
    }
  }
</code></pre>
",https://stackoverflow.com/questions/67231707/browserstack-custom-reporter-cypress-config,"['javascript', 'junit', 'mocha.js', 'cypress', 'browserstack']",313,False,1,0
GitLab CI Cypress E2E Hangs on &quot;Verifying Cypress&quot;,"<p>I am learning how to use GitLab CI / CD. My example project is a boilerplate VueJS App.</p>
<p>I have unit testing, docker builds and push to registry working, but I am struggling with Cypress e2e testing.</p>
<p>The e2e tests hang when verifying cypress and the test never ends. Here is the output of log.</p>
<pre><code>Running with gitlab-runner 13.8.0 (775dd39d)
  on Cypress/base:14.15.4 GGTzNUZr
Preparing the &quot;docker&quot; executor
00:12
Using Docker executor with image cypress/base:14.15.4 ...
Pulling docker image cypress/base:14.15.4 ...
Using docker image sha256:7bdb668124f5113a85870e35e904cda83549e6d2953493b1a3f566f63b242161 for cypress/base:14.15.4 with digest cypress/base@sha256:dad8727e107f61f48a3c6ef22cb651069cfd29fd377addcfbd7986c0a2659903 ...
Preparing environment
00:01
Running on runner-ggtznuzr-project-5-concurrent-0 via a467d812c00c...
Getting source from Git repository
00:01
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/learning/gitlab/vuejs_devops/.git/
Created fresh repository.
Checking out 127f8b87 as master...
Skipping Git submodules setup
Executing &quot;step_script&quot; stage of the job script
59:46
$ npm install
&gt; nodent-runtime@3.2.1 install /builds/learning/gitlab/vuejs_devops/node_modules/nodent-runtime
&gt; node build.js
## Built /builds/learning/gitlab/vuejs_devops/node_modules/nodent-runtime/dist/index.js
&gt; yorkie@2.0.0 install /builds/learning/gitlab/vuejs_devops/node_modules/yorkie
&gt; node bin/install.js
CI detected, skipping Git hooks installation
&gt; node-sass@4.14.1 install /builds/learning/gitlab/vuejs_devops/node_modules/node-sass
&gt; node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-83_binding.node
Download complete
Binary saved to /builds/learning/gitlab/vuejs_devops/node_modules/node-sass/vendor/linux-x64-83/binding.node
Caching binary to /root/.npm/node-sass/4.14.1/linux-x64-83_binding.node
&gt; core-js@2.6.12 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/@babel/runtime-corejs2/node_modules/core-js
&gt; node -e &quot;try{require('./postinstall')}catch(e){}&quot;
&gt; core-js@3.8.3 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/core-js
&gt; node -e &quot;try{require('./postinstall')}catch(e){}&quot;
&gt; ejs@2.7.4 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/ejs
&gt; node ./postinstall.js
&gt; cypress@3.8.3 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/cypress
&gt; node index.js --exec install
[08:07:00]  Downloading Cypress     [started]
[08:07:03]  Downloading Cypress     [completed]
[08:07:03]  Unzipping Cypress       [started]
[08:07:08]  Unzipping Cypress       [completed]
[08:07:08]  Finishing Installation  [started]
[08:07:08]  Finishing Installation  [completed]
&gt; node-sass@4.14.1 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/node-sass
&gt; node scripts/build.js
Binary found at /builds/learning/gitlab/vuejs_devops/node_modules/node-sass/vendor/linux-x64-83/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;x64&quot;})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;x64&quot;})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/mochapack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;x64&quot;})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.1 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;x64&quot;})
added 1610 packages from 1535 contributors and audited 1617 packages in 30.945s
72 packages are looking for funding
  run `npm fund` for details
found 3 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
$ npm run test:unit
&gt; cicd_test@0.1.0 test:unit /builds/learning/gitlab/vuejs_devops
&gt; vue-cli-service test:unit
Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools
You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html
 WEBPACK  Compiling...
 DONE  Compiled successfully in 2532ms
 WEBPACK  Compiled successfully in 2532ms
 MOCHA  Testing...
  HelloWorld.vue
    ✓ renders props.msg when passed
  1 passing (24ms)
 MOCHA  Tests completed successfully
$ npm run test:e2e
&gt; cicd_test@0.1.0 test:e2e /builds/learning/gitlab/vuejs_devops
&gt; vue-cli-service test:e2e
 INFO  Starting e2e tests...
 INFO  Starting development server...
 DONE  Compiled successfully in 5366ms8:07:24 AM
  App running at:
  - Local:   http://localhost:8080/ 
  It seems you are running Vue CLI inside a container.
  Access the dev server via http://localhost:&lt;your container's external mapped port&gt;/
  App is served in production mode.
  Note this is for preview or E2E testing only.
[08:07:24]  Verifying Cypress can run /root/.cache/Cypress/3.8.3/Cypress [started]
[08:07:26]  Verifying Cypress can run /root/.cache/Cypress/3.8.3/Cypress [completed]
ERROR: Job failed: execution took longer than 1h0m0s seconds
</code></pre>
<p>Here is my <code>.gitlab-ci.yml</code> file</p>
<pre><code>stages:
  - test
  - build

test:
  stage: test
  tags:
    - e2e-test
  script:
    - npm install
    - npm run test:unit
    - npm run test:e2e


docker-build:
  tags:
    - DOCKER
  image: docker:latest
  stage: build
  services:
    - docker:dind
  before_script:
    - echo $CI_BUILD_TOKEN | docker login -u &quot;$CI_REGISTRY_USER&quot; --password-stdin $CI_REGISTRY
  script:
    - docker build --pull -t &quot;$CI_REGISTRY_IMAGE&quot; .
    - docker push &quot;$CI_REGISTRY_IMAGE&quot;
</code></pre>
<p>My GitLab runner is using a docker image version <code>cypress/base:14.15.4</code> although I have also tried <code>cypress/base:10</code></p>
",https://stackoverflow.com/questions/66006177/gitlab-ci-cypress-e2e-hangs-on-verifying-cypress,"['docker', 'testing', 'continuous-integration', 'gitlab', 'cypress']",873,True,0,1
How to get id_token from refresh token issued by Google OAuth 2.0 Playground?,"<p>I trying to solve the problem with E2E testing and Gapi.js. So I created an ENV variable and handle Cypress differently if the environment is testing.</p>
<p>In order to achieve it, I need to get <code>id_token</code> somehow - with Gapi.js help or by the direct API call. What I have is: <code>client_id</code>, <code>client_secret</code>, <code>refresh_token</code>. After POST to <code>https://www.googleapis.com/oauth2/v4/token</code> I get <code>access_token</code>.</p>
<p>How can I get the final token with this data? Or there's any other way to E2E test signup with Google API library?</p>
",https://stackoverflow.com/questions/68754534/how-to-get-id-token-from-refresh-token-issued-by-google-oauth-2-0-playground,"['oauth-2.0', 'cypress', 'e2e-testing', 'google-authentication', 'google-api-js-client']",138,False,1,0
How to add cypress-plugin-tab to my Angular e2e testing?,"<p>I am using Angular12, NX, Cypress &amp; KendoUI.
I need to test tabbing through form elements.
How do I add cypress-plugin-tab to my e2e testing?</p>
<p>The guide says use require in the suppport/index.ts file - this is not working for me.</p>
<p>I have executed <code>npm install -D cypress-plugin-tab</code> and added <code>require('cypress-plugin-tab')</code> to suppport/index.ts
I have added this code to my test:</p>
<pre><code>   let password = 'Password';
   let input = cy.focused();
   
   input.type(username).tab().type(password);
</code></pre>
<p>This does not work as it says it cannot find 'tab'.
How do I get 'tab' to work in Angular?
<a href=""https://i.stack.imgur.com/UgTwn.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/UgTwn.png"" alt=""enter image description here"" /></a></p>
",https://stackoverflow.com/questions/68426404/how-to-add-cypress-plugin-tab-to-my-angular-e2e-testing,"['angular', 'cypress', 'angular-e2e', 'nomachine-nx']",661,True,1,1
E2E Test Automation workflow with GitLab CI/CD,"<p>I am to build a test automation system for E2E testing for a company. The product is React/Node.JS based runs in a cloud (Docker &amp; Kubernetes). The code is stored in GitLab repositories for which there are CI/CD pipelines setup for test/lint/deployment.</p>
<p>I plan to use Jest for test orchestration and Selenium / Appium for the UI testing (FRW being in TypeScript), while creating a generator to test our proprietary backend interface.
My code is in a similar repository and will be containerized and uploaded to the test environment.</p>
<p>In my former workplaces we used TeamCity and similar tools to manage test sessions but I do not seem to be able to find the perfect link between our already set up GitLab CI/CD and the E2E testing framework.</p>
<p>I know it could be implemented as part of the pipeline, but for me it seems lacking (which can also be because of my inexperience)</p>
<p>Could you advise some tools/methods for handling test session management for system testing in such an environment?
(with a GUI where I can see the progress of all sessions, being able to manage them, run / rerun / run on certain platforms only, etc)</p>
",https://stackoverflow.com/questions/65657061/e2e-test-automation-workflow-with-gitlab-ci-cd,"['testing', 'automated-tests', 'gitlab-ci', 'e2e-testing', 'system-testing']",518,False,2,0
Is there any console color contrast ratio checkers?,"<p>I'm working on automating accessibility testing and right now I'm looking for a console color contrast ratio checker. I know there are many browser extensions, but they are all manual and have graphical interface. My idea of it would be some tool that makes a screenshot, analyses it and gives back a text or image report with a number of violations and their location. The project I'm working on is a React application and I'm using Playwright for E2E testing.</p>
",https://stackoverflow.com/questions/70376429/is-there-any-console-color-contrast-ratio-checkers,"['testing', 'accessibility']",56,True,-1,1
Using detox can you test apps outside of our application made in React Native?,"<p>I'm using React Native to develop my app. I use detox as my E2E testing framework.</p>
<p>I want to test things outside of my app, for example:</p>
<ul>
<li>Browser search and deep-linking to my app.</li>
<li>Email sending in Gmail/outlook app when it opens from my app.</li>
<li>Photo gallery opening.</li>
<li>Camera, video recording.</li>
<li>(Maybe even mocking calling a number(?))</li>
</ul>
<p>I'm using react-native 0.64.1, detox 17.8.3, jest ^26.6.3.</p>
<p>I don't find any info and would like to know if someone has accomplished it already.</p>
",https://stackoverflow.com/questions/70282600/using-detox-can-you-test-apps-outside-of-our-application-made-in-react-native,"['react-native', 'email', 'emulation', 'detox', 'e2e']",250,False,1,0
how to properly test VueJS using cypress with istanbul code coverage when NODE_ENV=test,"<p>I am using cypress for E2E testing.</p>
<p>I am using Istanbul to calculate code coverage</p>
<p><strong>The above combination works well</strong> until I set <code>NODE_ENV=test</code> because in <code>tests/e2e/plugins/index.js</code> I need to use</p>
<pre><code>require('@cypress/code-coverage/task')(on, config);
</code></pre>
<p>When <code>NODE_ENV=test</code>, I don't think VUE compiles the source code, webpack is not used, and hence I get the error</p>
<pre><code>Uncaught ReferenceError: require is not defined
</code></pre>
<p>If I don’t differentiate between prod and test then my production code will also be instrumented by Istanbul, which I don't want to happen.</p>
<p>Can anyone tell me if I am missing something obvious here? Am I doing something wrong?</p>
",https://stackoverflow.com/questions/68047479/how-to-properly-test-vuejs-using-cypress-with-istanbul-code-coverage-when-node-e,"['vue.js', 'cypress', 'istanbul']",721,False,2,1
Calling from feature to features packaged as JAR,"<p>we are adopting Karate (Version: 0.9.9-RC3) as our main framework to do e2e testing in multiple projects and teams which need some common functionalities/features or scenarios to run.</p>
<p>We have thought about packaging a Karate Maven project as a JAR that contains these features and give the teams the chance to call this features and save them time and so on. Could be this possible?</p>
<p>We've tried to package some few test and call them from another feature as the following:</p>
<pre><code>Feature: Calling packaged features in JAR

Background:

Scenario: 

* def packagedFeature = call read('promotions.jar:resources/test.feature')
</code></pre>
<p>Any hint?</p>
",https://stackoverflow.com/questions/66012619/calling-from-feature-to-features-packaged-as-jar,"['automated-tests', 'karate', 'e2e-testing']",15,False,1,0
"Running ng e2e on Protractor with Cucumber in Angular gives EPERM: operation not permitted, rename error","<p>I'm trying to use Protractor with Cucumber for an E2E testing on an Angular project. I have protractor v5.4.4 installed. The first time I ran <code>ng e2e</code> the tests ran successfully, the second time I got this error:</p>
<pre><code>EPERM: operation not permitted, rename 'C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver.exe' -&gt; 'C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_96.0.4664.45.exe'
Error: EPERM: operation not permitted, rename 'C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver.exe' -&gt; 'C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_96.0.4664.45.exe'
    at Object.renameSync (fs.js:741:3)
    at unzip (C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\built\lib\cmds\update.js:240:8)
    at C:\Users\dmdum\Projects\angular-project\node_modules\protractor\node_modules\webdriver-manager\built\lib\cmds\update.js:205:13
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)
</code></pre>
<p><code>chromedriver_96.0.4664.45.exe</code> already exists in the specified path</p>
<p>For me to run the tests successfully again, I would need to delete the <code>selenium</code> folder specified in the path and then run <code>npx webdriver-manager update</code> again and then <code>ng e2e</code></p>
<p>But that's not a very good way to deal with the issue. Any help/suggestions would be greatly appreciated. Thanks!</p>
",https://stackoverflow.com/questions/70303699/running-ng-e2e-on-protractor-with-cucumber-in-angular-gives-eperm-operation-not,"['angular', 'selenium', 'protractor', 'cucumber', 'e2e']",136,False,0,1
String concat or interpolation on require() statement results in &quot;cannot find module&quot; error,"<p>I am trying to access i18n assets in an Angular project I'm working on in TypeScript, and part of our e2e testing gets the language the app is currently in from a config. I would like to pass that language value into the <code>require()</code> statement so I collect the correct JSON contents based on which language is needed for that test.</p>
<p>This works:</p>
<pre><code>const i18nAsset = require(`../../../../web/src/assets/i18n/en.json`);
</code></pre>
<p>This results in the error <code>Cannot find module '../../../../web/src/assets/i18n/en.json':</code></p>
<pre><code>const i18nAsset = require(`../../../../web/src/assets/i18n/${&quot;en&quot;}.json`);
</code></pre>
<p>As does this:</p>
<pre><code>const i18nAsset = require(&quot;../../../../web/src/assets/i18n/&quot; + &quot;en&quot; + &quot;.json&quot;);
</code></pre>
<p>What could be causing this? If it makes a difference, my e2e project is using Browserify, and the Angular application is using Webpack.</p>
",https://stackoverflow.com/questions/69620319/string-concat-or-interpolation-on-require-statement-results-in-cannot-find-mo,"['node.js', 'angular', 'typescript']",144,False,0,0
Are there any differences between MS Edge running on ubuntu or windows for End-to-end testing?,"<p>I'm setting up a e2e test stack with ms Playwright.
It should run in a ci pipeline. Playwright comes with a docker image:  <code>mcr.microsoft.com/playwright:focal</code>
which is bases on Ubuntu 20.04 LTS
I have noticed Edge is not included in the image. Edge (running on windows) is the primaire browser that we have to use for our e2e suit. Basically I want to install edge in the image: <a href=""https://www.microsoftedgeinsider.com/en-us/download/"" rel=""nofollow noreferrer"">https://www.microsoftedgeinsider.com/en-us/download/</a>
My question is: Has anybody experienced differences between running Edge on ubuntu and windows 10 which may impact e2e testing/ user experience.</p>
",https://stackoverflow.com/questions/68035410/are-there-any-differences-between-ms-edge-running-on-ubuntu-or-windows-for-end-t,"['windows', 'ubuntu', 'microsoft-edge', 'end-to-end', 'playwright']",149,False,1,1
E2E test an Outlook add-in,"<p>We have an Outlook add-in in the AppSource but are hoping to add automated tests to it to ensure no regressions during active development, since it is live already.</p>
<p>Is there any tooling provided by Microsoft for automated e2e testing of an Outlook add-in or any recommended ways to do this easily?</p>
<p>Since the add-in is just a web app, we considered running it separately but we'd be missing the entire Outlook context on the window... are there any test/mock objects for this either?</p>
",https://stackoverflow.com/questions/68945623/e2e-test-an-outlook-add-in,"['outlook-addin', 'outlook-web-addins']",191,True,0,1
How to dockerize an NX cypress e2e application,"<p>I've an NX workspace containing only one angular app and its e2e app, which is using cypress.</p>
<p>I'm trying to create a docker image for the e2e testing, but it fails when I run the docker container.
This is my <code>Dockerfile</code> which lives now in the root folder in the workspace.</p>
<pre><code>FROM node:lts-alpine
WORKDIR /app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /app/package.json
COPY decorate-angular-cli.js /app/decorate-angular-cli.js
RUN npm install
RUN npm install -g @angular/cli@latest
RUN npm install reflect-metadata tslib
# add cypress dependencies for image build 
RUN apk add xauth xvfb

# add app
COPY . /app
CMD npm run e2e -- --headless
</code></pre>
<p>The image is built but when I run the container I'm getting cypress dependencies error.</p>
<pre><code>✔ Browser application bundle generation complete.

Initial Chunk Files | Names         |      Size
vendor.js           | vendor        |  11.33 MB
styles.css          | styles        | 685.68 kB
polyfills.js        | polyfills     | 128.53 kB
main.js             | main          | 118.15 kB
runtime.js          | runtime       |   6.61 kB

| Initial Total |  12.25 MB

Build at: 2021-09-20T15:27:50.264Z - Hash: 8cbcb444b6a50b421afd - Time: 86112ms

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **


✔ Compiled successfully.
It looks like this is your first time using Cypress: 7.7.0

[STARTED] Task without title.
[FAILED] Cypress failed to start.
[FAILED]
[FAILED] This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies
[FAILED]
[FAILED] Please refer to the error below for more details.
[FAILED]
[FAILED] ----------
[FAILED]
[FAILED] Command failed with ENOENT: /root/.cache/Cypress/7.7.0/Cypress/Cypress --no-sandbox --smoke-test --ping=690
[FAILED] spawn /root/.cache/Cypress/7.7.0/Cypress/Cypress ENOENT
[FAILED]
[FAILED] ----------
[FAILED]
[FAILED] Platform: linux (Alpine Linux - 3.11.12)
[FAILED] Cypress Version: 7.7.0
Cypress failed to start.

This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies

Please refer to the error below for more details.

----------

Command failed with ENOENT: /root/.cache/Cypress/7.7.0/Cypress/Cypress --no-sandbox --smoke-test --ping=690
spawn /root/.cache/Cypress/7.7.0/Cypress/Cypress ENOENT

----------

Platform: linux (Alpine Linux - 3.11.12)
Cypress Version: 7.7.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! icert@2.0.0 e2e: `ng e2e &quot;--headless&quot;`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the icert@2.0.0 e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-20T15_27_51_378Z-debug.log
</code></pre>
<p>I need to know if this is the right way for dockerizing e2e apps with <code>Nx</code> and if so then what I'm missing here.</p>
<p>Thanks!</p>
",https://stackoverflow.com/questions/69257379/how-to-dockerize-an-nx-cypress-e2e-application,"['angular', 'docker', 'cypress', 'nrwl-nx']",1131,True,0,1
Integrate Puppeteer with Github CI,"<p>I'm starting to learn about e2e testing and I've decided on using Puppeteer for its documentation and support. However, I'm having some trouble figuring out how to integrate with Github CI on specific branches. All examples online seem to render a webpage with a given URL, but obviously, that's not possible if you're trying to test a branch before deployment and merging. Other examples show rendering localhost:3000, so I'm wondering if its possible to start the page using npm start, and then run npm test. How should I approach this?</p>
",https://stackoverflow.com/questions/65801651/integrate-puppeteer-with-github-ci,"['reactjs', 'testing', 'jestjs', 'puppeteer', 'e2e-testing']",79,False,0,1
"E2E test with Cypress, Nuxt and firebase","<p>I have a project using Nuxt for front-end and firebase for back-end. I had written unit test for it by using Jest. But when write E2E test using Cypress, I can not find the way to mock data when calling firebase-function:</p>
<pre><code>firebaseFunctions.httpsCallable(functionName)
</code></pre>
<p>I find a package is <a href=""https://www.npmjs.com/package/cypress-firebase"" rel=""nofollow noreferrer"">cypress-firebase</a> but it doesn't include firebase-function.</p>
<p>Please help me how to write E2E test for system using fireabse as server-side or best way to E2E testing such as test with staging URL. Thank you so much.</p>
",https://stackoverflow.com/questions/65572515/e2e-test-with-cypress-nuxt-and-firebase,"['firebase', 'nuxt.js', 'cypress', 'e2e-testing']",228,False,1,0
Struggling to build with Detox,"<p>I am looking to setup automated end to end UI testing for React Native App and its my first time doing it using detox.</p>
<p>I followed exact steps as mentioned in this article:
<a href=""https://varunon9.medium.com/e2e-testing-of-react-native-app-android-using-detox-a-step-by-step-guide-bfb520c1a9ac"" rel=""nofollow noreferrer"">https://varunon9.medium.com/e2e-testing-of-react-native-app-android-using-detox-a-step-by-step-guide-bfb520c1a9ac</a></p>
<p>But every time I try to run build command i.e: detox build -c android.emu.debug. I get the following error:</p>
<p>[Here is the console log from when I run the command]
[1]: <a href=""https://i.stack.imgur.com/zbLlO.png"" rel=""nofollow noreferrer"">https://i.stack.imgur.com/zbLlO.png</a></p>
<p>Any help would be greatly appreciated</p>
",https://stackoverflow.com/questions/65929194/struggling-to-build-with-detox,"['android', 'react-native', 'jestjs', 'automated-tests', 'detox']",375,True,0,1
"Error: &quot;detox-cli&quot; package is not meant to be installed locally, exiting","<p>I am trying to follow <a href=""https://blog.logrocket.com/end-to-end-testing-in-react-native-with-detox/"" rel=""nofollow noreferrer"">this link</a> to use detox for e2e testing for my react native app. I did it successfully once, but I removed e2e folder, was conducting some experiments, now I am not able to run <code>detox init -r jest</code>
every time I run this line it gives me this error:</p>
<pre><code>Error: &quot;detox-cli&quot; package is not meant to be installed locally, exiting...
HINT: Remove the local installation and reinstall it globally:
  npm uninstall detox-cli
  npm install -g detox-cli
</code></pre>
<p>I have tried the solution in the hint, but it didn't resolve the issue, any suggestions?
If I uninstall and run the command, same error shows up.
when I install it, this is what I see (node version and detox-cli version)</p>
<pre><code>/Users/.../.nvm/versions/node/v14.17.0/bin/detox -&gt; /Users/.../.nvm/versions/node/v14.17.0/lib/node_modules/detox-cli/cli.js
+ detox-cli@18.13.0
updated 1 package in 1.358s
</code></pre>
<p>-----Update:
I just tried this and worked:</p>
<pre><code>/Users/.../.nvm/versions/node/v14.17.0/bin/detox init -r jest
</code></pre>
",https://stackoverflow.com/questions/67607624/error-detox-cli-package-is-not-meant-to-be-installed-locally-exiting,"['react-native', 'detox']",406,False,3,0
"I need to move &#39;beforeEach&#39; and &#39;afterEach&#39; from spec to global config WDIO [mocha, hook, wdio]","<p>I use <strong>WebdriverIO</strong> for E2E testing with <strong>mocha</strong> framework</p>
<p>When I run tests, I want that after the first error, all subsequent checks in this test were skipped, and Mocha went to the next test file</p>
<p>as an example, I showed the code below which needs to be taken out from each test file and applied globally.</p>
<hr />
<p>I need to move <strong>beforeEach</strong> and <em>afterEach</em> from spec to global config WDIO [mocha, hook, wdio]</p>
<p>I need to move code from spec to global config WDIO</p>
<p>The main goal is to skip the tests after though the test in it has failed</p>
<pre class=""lang-js prettyprint-override""><code>import { expect } from 'chai';

describe('Verify next it is skipped', function () {
    let skipNextIt = false;
    beforeEach(function () {
        if (skipNextIt) {
            this.skip();
        }
    });

    afterEach(function() {
        if(this.currentTest.state === 'failed') {
            skipNextIt = true;
        }
    });

    it('is should pass', function () {
        expect(true).to.equal(true);
    });

    it('is should fail', function () {
        expect(true).to.equal(false);
    });

    it('is should skipp 1', function () {
        expect(true).to.equal(true);
    });

    it('is should skipp 2', function () {
        expect(true).to.equal(true);
    });
});
</code></pre>
",https://stackoverflow.com/questions/67109408/i-need-to-move-beforeeach-and-aftereach-from-spec-to-global-config-wdio-moc,"['typescript', 'mocha.js', 'hook', 'wdio-v6']",678,True,0,1
How to Dockerize VueJS app for production and skip installation of Dev dependencies,"<p>I have the following Dockerfile</p>
<pre><code>FROM node:lts-alpine

WORKDIR /app

COPY package*.json ./

RUN export NODE_ENV=production
RUN npm config set strict-ssl false

RUN npm install --only=prod
RUN npm i @vue/cli-service

COPY . ./

RUN npm run build:prod

RUN npm install -g http-server

EXPOSE 8080

CMD [&quot;http-server&quot; &quot;dist&quot;]

</code></pre>
<p>My dev environment includes Cypress for E2E testing, but when the <code>npm i @vue/cli-service</code> command runs, it fails with the following error</p>
<pre><code>Cypress Version: 3.8.3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;x64&quot;})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;x64&quot;})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/mochapack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;x64&quot;})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;linux&quot;,&quot;arch&quot;:&quot;x64&quot;})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypress@3.8.3 postinstall: `node index.js --exec install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cypress@3.8.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-03-27T11_53_21_406Z-debug.log
The command '/bin/sh -c npm i @vue/cli-service' returned a non-zero code: 1
ERROR: Job failed: exit status 1

</code></pre>
<p>here is my package.json file</p>
<pre><code>{
  &quot;name&quot;: &quot;todo-app&quot;,
  &quot;version&quot;: &quot;0.1.0&quot;,
  &quot;private&quot;: true,
  &quot;scripts&quot;: {
    &quot;serve&quot;: &quot;vue-cli-service serve&quot;,
    &quot;build:dev&quot;: &quot;vue-cli-service build --mode development&quot;,
    &quot;build:prod&quot;: &quot;vue-cli-service build --mode production&quot;,
    &quot;test:unit&quot;: &quot;vue-cli-service test:unit&quot;,
    &quot;test:e2e&quot;: &quot;vue-cli-service test:e2e&quot;,
    &quot;test:e2e:ci&quot;: &quot;vue-cli-service test:e2e --headless&quot;,
    &quot;lint&quot;: &quot;vue-cli-service lint&quot;
  },
  &quot;dependencies&quot;: {
    &quot;core-js&quot;: &quot;^3.6.5&quot;,
    &quot;vue&quot;: &quot;^2.6.11&quot;,
    &quot;vue-router&quot;: &quot;^3.2.0&quot;,
    &quot;vuex&quot;: &quot;^3.4.0&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;@vue/cli-plugin-babel&quot;: &quot;~4.5.0&quot;,
    &quot;@vue/cli-plugin-e2e-cypress&quot;: &quot;~4.5.0&quot;,
    &quot;@vue/cli-plugin-eslint&quot;: &quot;~4.5.0&quot;,
    &quot;@vue/cli-plugin-router&quot;: &quot;~4.5.0&quot;,
    &quot;@vue/cli-plugin-unit-mocha&quot;: &quot;~4.5.0&quot;,
    &quot;@vue/cli-plugin-vuex&quot;: &quot;~4.5.0&quot;,
    &quot;@vue/cli-service&quot;: &quot;~4.5.0&quot;,
    &quot;@vue/eslint-config-prettier&quot;: &quot;^6.0.0&quot;,
    &quot;@vue/test-utils&quot;: &quot;^1.0.3&quot;,
    &quot;babel-eslint&quot;: &quot;^10.1.0&quot;,
    &quot;chai&quot;: &quot;^4.1.2&quot;,
    &quot;eslint&quot;: &quot;^6.7.2&quot;,
    &quot;eslint-plugin-prettier&quot;: &quot;^3.3.1&quot;,
    &quot;eslint-plugin-vue&quot;: &quot;^6.2.2&quot;,
    &quot;node-sass&quot;: &quot;^4.12.0&quot;,
    &quot;prettier&quot;: &quot;^2.2.1&quot;,
    &quot;sass-loader&quot;: &quot;^8.0.2&quot;,
    &quot;vue-template-compiler&quot;: &quot;^2.6.11&quot;
  }
}

</code></pre>
<p>I seem to be in a catch 22. I can't build my VueJS App for production with out having the vue-cli-service, but vue-cli-service needs the dev dependencies installed and I can only install the dev dependencies if I include a lot of extra dependencies for testing etc in my Production Docker container that I don't want or need.</p>
<p>I am building my containers in a GitLab CI Runner.</p>
<p>How do other people get around this issue?</p>
",https://stackoverflow.com/questions/66831336/how-to-dockerize-vuejs-app-for-production-and-skip-installation-of-dev-dependenc,"['docker', 'vue.js']",770,False,3,1
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath &#39;./build/types&#39; is not defined by &quot;exports&quot; in .../node_modules/jest-circus/package.json,"<p>I'm trying to setup detox for e2e testing for my React Native app using jest and jest-circus. I am able to build my iOS app with detox by running <code>detox build --configuration ios</code> but have been unable to run the sample <code>firstTest.e2e.js</code> test with <code>detox run --configuration ios</code>. I get the following error:</p>
<pre><code>  ● Test suite failed to run

    Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './build/types' is not defined by &quot;exports&quot; in [project path]/node_modules/jest-circus/package.json

      at Object.&lt;anonymous&gt; (../node_modules/detox/runners/jest-circus/listeners/DetoxCoreListener.js:11:25)

detox[92379] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern '^((?!:android:).)*$' --maxWorkers 1 e2e
</code></pre>
<p>My package.json has the following libraries installed:</p>
<p><code>&quot;detox&quot;: &quot;^18.12.1&quot;,</code></p>
<p><code>&quot;jest&quot;: &quot;^24.9.0&quot;,</code></p>
<p><code>&quot;jest-circus&quot;: &quot;^27.1.0&quot;,</code></p>
<p>My .detoxrc.json file looks like this:</p>
<pre><code>{
  &quot;testRunner&quot;: &quot;jest&quot;,
  &quot;runnerConfig&quot;: &quot;e2e/config.json&quot;,
  &quot;apps&quot;: {
    &quot;ios&quot;: {
      &quot;type&quot;: &quot;ios.app&quot;,
      &quot;binaryPath&quot;: &quot;ios/build/Build/Products/Debug-iphonesimulator/appname.app&quot;,
      &quot;build&quot;: &quot;xcodebuild -workspace ios/appname.xcworkspace -scheme appname -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build EXCLUDED_ARCHS=arm64&quot;
    }
  },
  &quot;devices&quot;: {
    &quot;simulator&quot;: {
      &quot;type&quot;: &quot;ios.simulator&quot;,
      &quot;device&quot;: {
        &quot;type&quot;: &quot;iPhone 11&quot;
      }
    }
  },
  &quot;configurations&quot;: {
    &quot;ios&quot;: {
      &quot;device&quot;: &quot;simulator&quot;,
      &quot;app&quot;: &quot;ios&quot;
    }
  }
}
</code></pre>
<p>and my e2e/config.json file looks like this:</p>
<pre><code>{
    &quot;testEnvironment&quot;: &quot;./environment&quot;,
    &quot;testRunner&quot;: &quot;jest-circus/runner&quot;,
    &quot;testTimeout&quot;: 120000,
    &quot;testRegex&quot;: &quot;\\.e2e\\.js$&quot;,
    &quot;reporters&quot;: [&quot;detox/runners/jest/streamlineReporter&quot;],
    &quot;verbose&quot;: true
}
</code></pre>
<p>This is a fairly old project, and I am already using jest for unit testing. I wonder if there might be some other configuration file interfering with my e2e config but can't seem to figure it out just yet. Any help is welcome!</p>
",https://stackoverflow.com/questions/68991102/error-err-package-path-not-exported-package-subpath-build-types-is-not-de,"['react-native', 'jestjs', 'detox', 'jest-circus']",509,False,1,1
"How to overwrite a library (ex., path) in Angular with the mocked library I have created for testing?","<p>I am working on an Angular application that runs in Electron. However, we use cypress for E2E testing, and therefore I have mocked all the dependencies of Electron. So, we want the mocks to be used only when testing (to allow the app to be compiled in web) and not in the production code. Before I had created mocks in the prod code, but now I have to remove those from there. For example, I have the 'path' library which has to be replaced with the mocked one as soon as I run the test command. Could you please help me to solve that problem?</p>
",https://stackoverflow.com/questions/66963878/how-to-overwrite-a-library-ex-path-in-angular-with-the-mocked-library-i-have,"['angular', 'testing', 'mocking', 'testbed']",208,False,0,0
Trying to understand mocking google sign-in for Flutter,"<p>What I'm trying to do is test our sign-in widget for widget tests and later, integration testing and E2E testing.</p>
<p>So I have the following two mocks.  They both seem to require each other to work.</p>
<p>google_sign_in_mocks 0.2.1
<a href=""https://pub.dev/packages/google_sign_in_mocks"" rel=""nofollow noreferrer"">https://pub.dev/packages/google_sign_in_mocks</a></p>
<p>firebase_auth_mocks 0.8.1
<a href=""https://pub.dev/packages/firebase_auth_mocks"" rel=""nofollow noreferrer"">https://pub.dev/packages/firebase_auth_mocks</a></p>
<p>What I don't understand is <em>how</em> to use them.  I'm going through the docs and examples, and I don't get it.</p>
<p>For instance, I am looking at the <strong>google_sign_in_mocks</strong> example and I don't understand where <strong>MockGoogleSignIn</strong>, <strong>googleSignIn</strong> and <strong>.authentication</strong> comes from.</p>
<p>I'm reading additional docs like <a href=""https://firebase.flutter.dev/docs/auth/usage"" rel=""nofollow noreferrer"">https://firebase.flutter.dev/docs/auth/usage</a>, but it feels like things are spiraling out of control.</p>
<p>Can someone help explain some of this for me?</p>
",https://stackoverflow.com/questions/69214472/trying-to-understand-mocking-google-sign-in-for-flutter,"['firebase', 'flutter', 'testing', 'mocking', 'google-signin']",379,False,3,0
CoreUi - why nightwatch cannot run e2e tests?,"<p>I want to start working with CoreUi Admin template and create project containing unit and e2e testing.</p>
<p>In the begining, I install CoreUi like shown in documentation:</p>
<pre><code>git clone https://github.com/coreui/coreui-free-vue-admin-template.git CoreUI-Vue
cd CoreUI-Vue
npm install
</code></pre>
<p>Everything is ok. Now I want to run whole unit and e2e tests:</p>
<pre><code>npm run test:unit   
npm run test:e2e
</code></pre>
<p>All unit tests run properly. But when I run e2e test I got the following errors:</p>
<pre><code>&gt; @coreui/coreui-free-vue-admin-template@3.1.4 test:e2e
&gt; vue-cli-service test:e2e

 INFO  Starting development server...
[BABEL] Note: The code generator has deoptimised the styling of /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/@coreui/vue/dist/coreui-vue.common.js as it exceeds the max of 500KB.


 WARNING  Compiled with 2 warnings                                                                                                                                                                       2:47:38 PM
 warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  css/app.10fee0d6.css (383 KiB)                                                                                                                                                                                     js/chunk-28d6db65.e7636129.js (488 KiB)
  js/chunk-2d0a400c.650c6f3a.js (3.37 MiB)                                                                                                                                                                           js/chunk-2d0ae5e6.22010046.js (390 KiB)
  js/chunk-2d237b34.468fc7b7.js (1.36 MiB)
  js/chunk-vendors.03b8fe62.js (687 KiB)

 warning

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (1.07 MiB)
      js/chunk-vendors.03b8fe62.js
      css/app.10fee0d6.css
      js/app.94002fbe.js


                                                                                                                                                                                                                     App running at:
  - Local:   http://localhost:8080/
  - Network: http://172.31.33.121:8080/

  App is served in production mode.
  Note this is for preview or E2E testing only.

 INFO  Running end-to-end tests ...

[Test] Test Suite
=================
⚠ Error connecting to localhost on port 9515.
_________________________________________________
TEST FAILURE: 1 error during execution; 0 tests failed, 0 passed (348ms)

 ✖ test
   An error occurred while retrieving a new session: &quot;unknown error: Chrome failed to start: exited abnormally.&quot;
Error: An error occurred while retrieving a new session: &quot;unknown error: Chrome failed to start: exited abnormally.&quot;
    at endReadableNT (_stream_readable.js:1201:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

  Error: An error occurred while retrieving a new session: &quot;unknown error: Chrome failed to start: exited abnormally.&quot;                                                                                                    at endReadableNT (_stream_readable.js:1201:12)
       at processTicksAndRejections (internal/process/task_queues.js:84:21)

   SKIPPED:
   - CoreUI Vue e2e tests

 ERROR  Error: Command failed: /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/nightwatch/bin/nightwatch --config /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js --env chrome
Error: Command failed: /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/nightwatch/bin/nightwatch --config /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js --env chrome
    at makeError (/home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/execa/index.js:174:9)
    at /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/execa/index.js:278:16
    at runMicrotasks (&lt;anonymous&gt;)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
bagsiur@DESKTOP-718MBR1:~/Projects/B2B/test-coreui/CoreUI-Vue$
bagsiur@DESKTOP-718MBR1:~/Projects/B2B/test-coreui/CoreUI-Vue$ npm run test:e2e

&gt; @coreui/coreui-free-vue-admin-template@3.1.4 test:e2e
&gt; vue-cli-service test:e2e

 INFO  Starting development server...


 WARNING  Compiled with 2 warnings                                                                                                                                                                       3:06:39 PM
 warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  css/app.10fee0d6.css (383 KiB)
  js/chunk-28d6db65.e7636129.js (488 KiB)
  js/chunk-2d0a400c.650c6f3a.js (3.37 MiB)
  js/chunk-2d0ae5e6.22010046.js (390 KiB)
  js/chunk-2d237b34.468fc7b7.js (1.36 MiB)
  js/chunk-vendors.03b8fe62.js (687 KiB)

 warning
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (1.07 MiB)
      js/chunk-vendors.03b8fe62.js
      css/app.10fee0d6.css
      js/app.94002fbe.js



  App running at:
  - Local:   http://localhost:8080/
  - Network: http://172.31.33.121:8080/

  App is served in production mode.
  Note this is for preview or E2E testing only.                                                                                                                                                                    
 INFO  Running end-to-end tests ...                                                                                                                                                                                
[Test] Test Suite
=================
⚠ Error connecting to localhost on port 9515.
_________________________________________________

TEST FAILURE: 1 error during execution; 0 tests failed, 0 passed (348ms)

 ✖ test
   An error occurred while retrieving a new session: &quot;unknown error: Chrome failed to start: exited abnormally.&quot;
Error: An error occurred while retrieving a new session: &quot;unknown error: Chrome failed to start: exited abnormally.&quot;
    at endReadableNT (_stream_readable.js:1201:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

  Error: An error occurred while retrieving a new session: &quot;unknown error: Chrome failed to start: exited abnormally.&quot;                                                                                                    at endReadableNT (_stream_readable.js:1201:12)
       at processTicksAndRejections (internal/process/task_queues.js:84:21)

   SKIPPED:
   - CoreUI Vue e2e tests

 ERROR  Error: Command failed: /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/nightwatch/bin/nightwatch --config /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js --env chrome
Error: Command failed: /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/nightwatch/bin/nightwatch --config /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js --env chrome
    at makeError (/home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/execa/index.js:174:9)
    at /home/bagsiur/Projects/B2B/test-coreui/CoreUI-Vue/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
</code></pre>
<p>I work on wsl2 and Debian. My node.js version is v13.14.0 and npm is 7.12.1. I installed chromedriver in version: ChromeDriver 2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706) and last stable google chrome: google-chrome-stable 90.0.4430.212-1</p>
<p>What do I miss? Where could be the cause of the error in running e2e tests?</p>
<p>@UPDATE: I put the configuration of Nightwatch.conf.json:</p>
<pre><code>// http://nightwatchjs.org/gettingstarted#settings-file

const path = require('path')
const deepmerge = require('deepmerge')
const chromedriver = require('chromedriver')

// user may have not installed geckodriver
let geckodriver = {}
try {
  geckodriver = require('geckodriver')
} catch (e) {}

const userOptions = JSON.parse(process.env.VUE_NIGHTWATCH_USER_OPTIONS || '{}')
const useSelenium = process.env.VUE_NIGHTWATCH_USE_SELENIUM === '1'
const startHeadless = process.env.VUE_NIGHTWATCH_HEADLESS === '1'
const concurrentMode = process.env.VUE_NIGHTWATCH_CONCURRENT === '1'
const chromeArgs = []
const geckoArgs = []

if (startHeadless) {
  chromeArgs.push('headless')
  geckoArgs.push('--headless')
}

const defaultSettings = {
  src_folders: ['tests/e2e/specs'],
  output_folder: 'tests/e2e/reports',
  page_objects_path: 'tests/e2e/page-objects',
  custom_assertions_path: 'tests/e2e/custom-assertions',
  custom_commands_path: 'tests/e2e/custom-commands',
  globals_path: path.resolve('tests/e2e/globals.js'),
  test_workers: concurrentMode,
  test_settings: {
    default: {
      detailed_output: !concurrentMode,
      launch_url: '${VUE_DEV_SERVER_URL}'
    },

    chrome: {
      desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions: {
          w3c: false,
          args: chromeArgs
        }
      }
    },

    firefox: {
      desiredCapabilities: {
        browserName: 'firefox',
        alwaysMatch: {
          acceptInsecureCerts: true,
          'moz:firefoxOptions': {
            args: geckoArgs
          }
        }
      },
      webdriver: useSelenium ? {} : {
        server_path: geckodriver.path,
        port: 4444
      }
    }
  }
}

const baseSettings = deepmerge(defaultSettings, webdriverServerSettings())

module.exports = deepmerge(baseSettings, adaptUserSettings(userOptions))

function adaptUserSettings (settings) {
  // The path to nightwatch external globals file needs to be made absolute
  // if it is supplied in an additional config file, due to merging of config files
  if (settings.globals_path) {
    settings.globals_path = path.resolve(settings.globals_path)
  }

  return settings
}

function webdriverServerSettings () {
  if (useSelenium) {
    return {
      selenium: {
        start_process: true,
        host: '127.0.0.1',
        port: 4444,
        server_path: require('selenium-server').path,
        cli_args: {
          'webdriver.chrome.driver': chromedriver.path,
          'webdriver.gecko.driver': geckodriver.path
        }
      }
    }
  }

  return {
    webdriver: {
      start_process: true,
      port: 9515,
      server_path: chromedriver.path
    }
  }
}
</code></pre>
",https://stackoverflow.com/questions/67519595/coreui-why-nightwatch-cannot-run-e2e-tests,"['vue.js', 'nightwatch.js', 'core-ui']",326,True,0,1
How to test two systems with different base URLs in a single test suite?,"<p>I'm working on a project that has multiple systems. (ex: admin portal, client portal, etc.) and there are different environments in each system (ex: dev env, QA env, etc.) There is a separate QA repository for e2e testing and I need to test different systems with different URLs in a single test suite.</p>
<p>This question <a href=""https://stackoverflow.com/questions/63285829/cypress-baseurl-configuation"">Cypress baseUrl configuation</a> suggests a method of using multiple params in <code>cypress.json</code> to represent the different systems URLs and to use a <code>Cypress.config()</code> to refer to the correct URL. However, that method does not make use of the <code>baseURL</code> property of Cypress.</p>
<p>Is there any in-built capability in Cypress to support the testing of multiple systems in a single test suite? (for example, switch the <code>baseURL</code> from within test code or something of that sort)</p>
",https://stackoverflow.com/questions/68205012/how-to-test-two-systems-with-different-base-urls-in-a-single-test-suite,['cypress'],1006,True,4,1
Cypress in Angular with cucumber &gt; process is not defined,"<p>I try to use Cypress for e2e testing in an Angular 12 project with Cucumber and TypeScript.</p>
<p>Cypress itself starts successfully via <code>npx cypress open</code> and the feature file I created is shown:
<a href=""https://i.stack.imgur.com/Q5ld8.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/Q5ld8.png"" alt=""cypress with custom feature file"" /></a></p>
<p>When I start the test for this feature, I receive the following error:
<a href=""https://i.stack.imgur.com/Y8LT9.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/Y8LT9.png"" alt=""error in cypress browser"" /></a></p>
<p>I found a similar issue <a href=""https://stackoverflow.com/questions/69475201/the-following-error-originated-from-your-test-code-not-from-cypress-process-i"">here</a> but no solution I could apply. I believe this error occurs because I am using the cypress-own browser and the process variable is not available there. I also had a look at this <a href=""https://github.com/TheBrainFamily/cypress-cucumber-typescript-example/"" rel=""nofollow noreferrer"">repository</a> but failed to find anything that would solve this issue.</p>
<p>The package.json of this project looks like this:</p>
<pre><code>{   &quot;name&quot;: &quot;randomAppName&quot;,   &quot;version&quot;: &quot;0.0.0&quot;,   &quot;scripts&quot;: {
    &quot;ng&quot;: &quot;ng&quot;,
    &quot;start&quot;: &quot;ng serve&quot;,
    &quot;build&quot;: &quot;ng build&quot;,
    &quot;watch&quot;: &quot;ng build --watch --configuration development&quot;,
    &quot;test&quot;: &quot;ng test&quot;,
    &quot;i18n&quot;: &quot;ng extract-i18n --output-path src/assets/i18n&quot;,
    &quot;lint&quot;: &quot;eslint . --ext .ts,.js&quot;,
    &quot;lint-fix&quot;: &quot;eslint . --ext .ts,.js&quot;   },   &quot;private&quot;: true,   &quot;dependencies&quot;: {
    &quot;@angular/animations&quot;: &quot;~12.2.0&quot;,
    &quot;@angular/cdk&quot;: &quot;^12.2.5&quot;,
    &quot;@angular/common&quot;: &quot;~12.2.0&quot;,
    &quot;@angular/compiler&quot;: &quot;~12.2.0&quot;,
    &quot;@angular/core&quot;: &quot;~12.2.0&quot;,
    &quot;@angular/forms&quot;: &quot;~12.2.0&quot;,
    &quot;@angular/material&quot;: &quot;^12.2.5&quot;,
    &quot;@angular/platform-browser&quot;: &quot;~12.2.0&quot;,
    &quot;@angular/platform-browser-dynamic&quot;: &quot;~12.2.0&quot;,
    &quot;@angular/router&quot;: &quot;~12.2.0&quot;,
    &quot;@ngrx/effects&quot;: &quot;^12.4.0&quot;,
    &quot;@ngrx/store&quot;: &quot;^12.4.0&quot;,
    &quot;@ngrx/store-devtools&quot;: &quot;^12.4.0&quot;,
    &quot;moment&quot;: &quot;^2.29.1&quot;,
    &quot;ngrx-forms&quot;: &quot;^6.3.5&quot;,
    &quot;path-browserify&quot;: &quot;^1.0.1&quot;,
    &quot;rxjs&quot;: &quot;~6.6.0&quot;,
    &quot;tslib&quot;: &quot;^2.3.0&quot;,
    &quot;zone.js&quot;: &quot;~0.11.4&quot;   },   &quot;cypress-cucumber-preprocessor&quot;: {
    &quot;nonGlobalStepDefinitions&quot;: true   },   &quot;devDependencies&quot;: {
    &quot;@4tw/cypress-drag-drop&quot;: &quot;^1.8.0&quot;,
    &quot;@angular-devkit/build-angular&quot;: &quot;~12.2.5&quot;,
    &quot;@angular-eslint/builder&quot;: &quot;12.7.0&quot;,
    &quot;@angular-eslint/eslint-plugin&quot;: &quot;12.7.0&quot;,
    &quot;@angular-eslint/eslint-plugin-template&quot;: &quot;12.7.0&quot;,
    &quot;@angular-eslint/schematics&quot;: &quot;12.7.0&quot;,
    &quot;@angular-eslint/template-parser&quot;: &quot;12.7.0&quot;,
    &quot;@angular/cdk&quot;: &quot;^12.0.1&quot;,
    &quot;@angular/cli&quot;: &quot;~12.2.5&quot;,
    &quot;@angular/common&quot;: &quot;^12.0.1&quot;,
    &quot;@angular/compiler-cli&quot;: &quot;~12.2.0&quot;,
    &quot;@angular/core&quot;: &quot;^12.0.1&quot;,
    &quot;@angular/localize&quot;: &quot;^12.2.5&quot;,
    &quot;@cucumber/cucumber&quot;: &quot;^7.2.1&quot;,
    &quot;@cypress/browserify-preprocessor&quot;: &quot;^3.0.1&quot;,
    &quot;@cypress/webpack-preprocessor&quot;: &quot;^5.9.0&quot;,
    &quot;@jscutlery/cypress-harness&quot;: &quot;^0.3.4&quot;,
    &quot;@types/jasmine&quot;: &quot;~3.8.0&quot;,
    &quot;@types/node&quot;: &quot;^12.11.1&quot;,
    &quot;@typescript-eslint/eslint-plugin&quot;: &quot;4.28.2&quot;,
    &quot;@typescript-eslint/parser&quot;: &quot;4.28.2&quot;,
    &quot;cucumber&quot;: &quot;^6.0.5&quot;,
    &quot;cucumber-pretty&quot;: &quot;^6.0.0&quot;,
    &quot;cucumber-tsflow&quot;: &quot;^4.0.0-rc.1&quot;,
    &quot;cypress&quot;: &quot;^8.4.0&quot;,
    &quot;cypress-cucumber-preprocessor&quot;: &quot;^4.3.1&quot;,
    &quot;cypress-mouse-position&quot;: &quot;^1.0.0&quot;,
    &quot;cypress-pipe&quot;: &quot;^2.0.0&quot;,
    &quot;cypress-xpath&quot;: &quot;^1.6.2&quot;,
    &quot;eslint&quot;: &quot;^7.26.0&quot;,
    &quot;eslint-config-airbnb-base&quot;: &quot;^14.2.1&quot;,
    &quot;eslint-plugin-import&quot;: &quot;^2.25.2&quot;,
    &quot;jasmine-core&quot;: &quot;~3.8.0&quot;,
    &quot;jest&quot;: &quot;^27.2.0&quot;,
    &quot;karma&quot;: &quot;~6.3.0&quot;,
    &quot;karma-chrome-launcher&quot;: &quot;~3.1.0&quot;,
    &quot;karma-coverage&quot;: &quot;~2.0.3&quot;,
    &quot;karma-jasmine&quot;: &quot;~4.0.0&quot;,
    &quot;karma-jasmine-html-reporter&quot;: &quot;~1.7.0&quot;,
    &quot;prettier&quot;: &quot;^2.5.1&quot;,
    &quot;rxjs&quot;: &quot;^6.6.7&quot;,
    &quot;ts-loader&quot;: &quot;^9.2.6&quot;,
    &quot;ts-node&quot;: &quot;^9.1.1&quot;,
    &quot;tsify&quot;: &quot;^4.0.1&quot;,
    &quot;typescript&quot;: &quot;~4.3.5&quot;,
    &quot;webpack&quot;: &quot;^5.65.0&quot;,
    &quot;zone.js&quot;: &quot;^0.11.4&quot;   },   &quot;browser&quot;: {
    &quot;fs&quot;: false,
    &quot;os&quot;: false,
    &quot;path&quot;: false   } }
</code></pre>
<p>The webpack.config.js looks as follows:</p>
<pre><code>module.exports = {
  resolve: {
    modules: [&quot;node_modules&quot;],
    extensions: [&quot;*&quot;, &quot;.js&quot;, &quot;.jsx&quot;, &quot;.json&quot;],
    symlinks: false,
    cacheWithContext: false,
    fallback: { path: require.resolve(&quot;path-browserify&quot;) },
  },
  node: {},
  module: {
    rules: [
      {
        test: /\.ts$/,
        exclude: /node_modules/,
        use: [
          {
            loader: &quot;ts-loader&quot;,
          },
        ],
      },
      {
        test: /\.feature$/,
        use: [
          {
            loader: &quot;cypress-cucumber-preprocessor/loader&quot;,
          },
        ],
      },
    ],
  },
};
</code></pre>
<p>Please let me know, if any additional information is needed, I will gladly provide it.</p>
",https://stackoverflow.com/questions/70519821/cypress-in-angular-with-cucumber-process-is-not-defined,"['angular', 'typescript', 'cucumber', 'cypress']",1488,True,3,1
Css-selector is not able to identify element in WEBVIEW in iOS hybrid app(build in Ionic+angular) while doing e2e testing using Appium,"<p>I am doing e2e testing on iPhone 11 (real device) for a hybrid app built using ionic +angular and using CSS-selector to click/tap elements. It can not identify the text field even though it is available in the webview. I also tried to access the text field via XPATH but it did not work either.</p>
<p>Angular: 10.1.5
Angular CLI: 10.1.6
Node: 14.15.4
typescript: 4.0.3
ionic : 5.2.3
appium : 1.20.2</p>
<p>I also read this thread: <a href=""https://discuss.appium.io/t/not-able-to-identify-element-in-webview-in-ios-hyprid-app-build-in-ionic-automation-using-appium-on-real-device/10244/8"" rel=""nofollow noreferrer"">https://discuss.appium.io/t/not-able-to-identify-element-in-webview-in-ios-hyprid-app-build-in-ionic-automation-using-appium-on-real-device/10244/8</a></p>
<p>Until now, it was not able to identify.
Please let me know if anyone of you has any leads regarding this issue.</p>
<p>Thanks</p>
<p>Sukriti</p>
",https://stackoverflow.com/questions/66419421/css-selector-is-not-able-to-identify-element-in-webview-in-ios-hybrid-appbuild,"['angular', 'ionic-framework', 'automated-tests', 'appium', 'hybrid-mobile-app']",178,False,1,0
What&#39;s the benefit of E2E testing only against latest browser versions,"<p>When performing end-to-end tests with tools such as Playwright, Puppeteer and Cypress, I believe all of them <em>(<a href=""https://docs.cypress.io/guides/guides/launching-browsers#Launching-by-a-path"" rel=""nofollow noreferrer"">except the latter</a>, pardon me if I'm wrong)</em> only allow you to use the very latest version of each browser which is bundled along with every release.</p>
<p>In that case, I was wondering what would be the real benefit of running your acceptance end-to-end tests which would only validate functionality against a more limited scenario instead of, for example, making sure your application would still work on Chrome 70?</p>
<p>Any insights about why considering only recent browser versions and forgetting about the rest is a good idea, by using Playwright instead of a tool which would allow targeting tests against a specific browser binary, for example and have your E2E testing resulting like:</p>
<pre><code>PASS. Shopping-Cart (Modern)
FAIL. Shopping-Cart (chrome 70) 
// Refactor
</code></pre>
<p>instead of</p>
<pre><code>PASS. Shopping-Cart
// Yay! Release
</code></pre>
",https://stackoverflow.com/questions/67033300/whats-the-benefit-of-e2e-testing-only-against-latest-browser-versions,"['puppeteer', 'cypress', 'e2e-testing', 'playwright']",407,True,5,1
E2E Testing a frontend and mock a request the backend is making with Cypress,"<p>Currently when creating a customer during an e2e testcase, my stripe-like payment gateway says &quot;Customer already exists&quot; which is true because this testcase has been run once already.</p>
<p>What is the high level solution? If it would be a unit test, I think mocking the payment-provider request would be the way to go. But in this case I can only intercept the requests that go from my frontend, right? I could mock away the whole request to my backend but that's not the point of e2e testing I think.</p>
<p>I also thought about some sort of flag or environment variable so that the backend knows if it's currently e2e tested (and in this case behave differently, eg not make this specific request). But I think that's not good practice.</p>
",https://stackoverflow.com/questions/66642867/e2e-testing-a-frontend-and-mock-a-request-the-backend-is-making-with-cypress,"['testing', 'mocking', 'cypress', 'e2e-testing']",272,False,0,1
"electron, Vuejs app not launched e2e selenium, python","<p>I am looking for steps to perform e2e testing using selenium, python for electron app.</p>
<ol>
<li><p>sample app to create and run in electron, vuejs.</p>
<p>npm install electron --save-dev
npm install -g @vue/cli
vue create new-app
vue add electron-builder</p>
<p>launch app to test:</p>
<p>npm run serve</p>
<p>npm run electron:serve</p>
</li>
<li><p>download chrome driver.</p>
</li>
<li><p>create python (py) with following code:</p>
<p>from selenium import webdriver</p>
<p>from webdriver_manager.chrome import ChromeDriverManager</p>
<p>driver = webdriver.Chrome(executable_path=r'C:/Users/ddd/Downloads/chromedriver_win32/chromedriver.exe')</p>
<p>remote_app = webdriver.remote.webdriver.WebDriver(
command_executor=f'http://localhost:9515',
desired_capabilities = {'chromeOptions':{ 'binary':
'C:/Users/ddd/source/repos/vueselenium/new-app/node_modules/.bin/electron'}},
browser_profile=None,
proxy=None,
keep_alive=False)</p>
<p>print(&quot;Page Title is : %s&quot; %driver.title)
driver.maximize_window()
print(driver.title)
driver.quit()</p>
</li>
</ol>
<p>Not able to launch the electron app from this python file.<br />
Thanks for your help.</p>
",https://stackoverflow.com/questions/69568407/electron-vuejs-app-not-launched-e2e-selenium-python,"['python', 'selenium', 'electron', 'e2e-testing']",116,False,0,1
Is it possible to use Cypress for E2E testing when keycloak protectes the site,"<p>I am using Cypress for E2E testing. I also use Keycloak to provide Authentication.</p>
<p>Keycloak uses an external website login form, however, this is not supported by Cypress when it is on a different domain to that being tested.</p>
<p>I know in most cases you would avoid testing the login functionality of 3rd party provider, but in my case, I use the functions built to the Keycloak-js library such as checking for role permissions to validate if a user can access a page.</p>
<p>Without being able to login <strong>through</strong> the keycloak-js adapter, Cypress can not test any of my site.</p>
<p>I am able to login to keycloak via the API using <code>grant_type = password</code> via fetch. This provides me with a token, refresh token and session id. Is there a way I might <strong>init</strong> the keycloak-js adapter with these tokens?</p>
",https://stackoverflow.com/questions/66128342/is-it-possible-to-use-cypress-for-e2e-testing-when-keycloak-protectes-the-site,"['javascript', 'testing', 'single-sign-on', 'keycloak', 'cypress']",591,False,1,0
How to check visibility of snack bar and click on action in e2e test using protractor?,"<p>I do e2e testing using a protractor but facing an issue with the snack bar.
This is a screenshot of the working app:-<a href=""https://i.stack.imgur.com/PN3IC.png"" rel=""nofollow noreferrer"">Working demo</a></p>
<p>The problem is that how to check visibility of snackbar that snackbar is occur on page and how to click undo action on that snackbar</p>
<p>This is the code for snackbar:-</p>
<pre><code>openSnackBar(payload) {
    const snackBarRef = this.snackbar.open(payload.message, 'Undo', {
      duration: 5000
    });

    snackBarRef
      .onAction()
      .pipe(take(1))
      .subscribe(() =&gt; {
        this.store.dispatch(payload.undoAction);
      });
  }
</code></pre>
<p>The e2e test flow is like this:-</p>
<ol>
<li>search for books</li>
<li>check the count</li>
<li>Click want to read</li>
<li>click on the reading list and check the count which will be one</li>
<li>Check if snack bar appeared</li>
<li>Click undo action on the snackbar</li>
<li>Check if the readlist item count is zero</li>
</ol>
<p>The e2e test file :</p>
<pre><code>  it('Then: I should undo added book to reading list', async () =&gt; {
    await browser.get('/');
    await browser.wait(
      ExpectedConditions.textToBePresentInElement($('tmo-root'), 'okreads')
    );

    const form = await $('form');
    const input = await $('input[type=&quot;search&quot;]');
    await input.sendKeys('javascript');
    await form.submit();
    const items = await $$('[data-testing=&quot;book-item&quot;]');
    expect(items.length).toBeGreaterThan(1);

    const wantToReadButton = await $$('[data-testing=&quot;want-to-read-button&quot;]').get(0)
    await wantToReadButton.click();

    
    const readingListToggle = await $('[data-testing=&quot;toggle-reading-list&quot;]');
    await readingListToggle.click();
    const readingListItems = await $$('[data-testing=&quot;readinglist-item&quot;]');
    expect(readingListItems.length).toBe(1);

   // const snackBar = await browser.driver.findElement(By.tagName('simple-snack-bar'))
   
    // await element(by.buttonText('close')).click()
    // browser.wait(ExpectedConditions.presenceOf($('simple-snack-bar')),5000)
    // await element(by.buttonText('Undo')).click();
    // const undoButton = await element(by.buttonText('Undo'));
    // await undoButton.click();
    // await browser.executeScript(&quot;arguments[0].click();&quot;, element(by.css('.mat-simple-snackbar-action')).getWebElement());

  });
</code></pre>
<p>I tried with different option for snackbar visibility and for click on to undo action , but got error that snackbar element  isn't present</p>
<p>so please anyone give help regarding that ?</p>
",https://stackoverflow.com/questions/66927705/how-to-check-visibility-of-snack-bar-and-click-on-action-in-e2e-test-using-protr,"['angular', 'angular-material', 'protractor', 'e2e-testing']",656,True,0,1
Angular ViewEncapsulation.ShadowDom elements in Protractor give StaleElementExceptionError,"<p>I have an iframe inside an angular component, into which I am injecting a component X dynamically using component factory (appending the native element to the iframe's body). The reason I am doing this is because I need media queries to function in the component. Without ViewEncapsulation.ShadowDom the component injected inside the frame will be 'style-less'.</p>
<p>Until now everything is fine and dandy and the feature works exactly as I want. However, during e2e testing I am not able to access any elements inside the <strong>shadow-root</strong>, I have tried multiple methods like <code>document.querySelector('component-id').shadowRoot.querySelector('element-id')</code> and even libraries and work arounds that are mentioned <a href=""https://github.com/angular/protractor/issues/4367"" rel=""nofollow noreferrer"">here</a>.</p>
<p>Everything results in the same error</p>
<blockquote>
<p>StaleElementReferenceError: stale element reference: stale element not
found</p>
</blockquote>
<p>To summarize,</p>
<ul>
<li>An angular component with Shadow Dom encapsulation is being injected into an iframe</li>
<li>Cannot access the elements inside the shadowroot of the injected component using all the available methods</li>
</ul>
",https://stackoverflow.com/questions/68485201/angular-viewencapsulation-shadowdom-elements-in-protractor-give-staleelementexce,"['angular', 'protractor', 'angular-e2e']",311,True,2,1
Project relative paths in cypress code coverage,"<p>I'm using Cypress for client e2e testing and <strong>@cypress/code-coverage</strong> for reports. I have a <strong>monorepo</strong>, client and server folders. Each one generates its own coverage report (lcov.info). I am using CodeClimate for keeping track o total coverage. It provides a tool to merge multiple reports into one, and then upload it
The problem is that both reports have relative paths (regarding the tested files) to is service, so /client/coverage/lcov.info does not build path as <code>'client/component/index.ts'</code> but <code>/component/index.ts</code> so report merging fails</p>
<p>I can fix this on the server side passing some options to jest-conf, but I didnt fine nothing related to cypress. I can generate the report folder/files in the root level passing an option to nyc (which is used under to hood by @cypress/code-coverage), but the paths are still relatives to the client folder.</p>
<p>Has anyone experienced this issue? Help much appreciated</p>
",https://stackoverflow.com/questions/67904775/project-relative-paths-in-cypress-code-coverage,"['code-coverage', 'cypress', 'code-climate']",285,False,2,0
Playwright e2e testing. What to do with oauth2 or email-passwordless authentication,"<p>I am starting to do e2e tests with playwright.
Most of the application requires to be authenticated. Automating this with a username/password mechanism is quite easy. The problem is that the app I want to test has only two authentication mechanisms: Github OAuth and email authentication links. Specifically I am using next-auth in a NextJS project.</p>
<p>I don't know how should I e2e test this with Playwright, the options I have considered are:</p>
<ul>
<li>Completly mocking the authentication using a mock user and a mock session and then append the session token in the test context (as it is described <a href=""https://playwright.dev/docs/auth/#reuse-authentication-state"" rel=""noreferrer"">here</a> in the official docs).</li>
<li>Creating a Github user and/or an email account for the tests and somehow truly use them in playwrigth.</li>
</ul>
<p>The first option is much easier to implement but then it's not e2e testing anymore. The second option looks difficult to implement and I don't know if it is recommended. I don't know if there are smarter or more standarized ways to proceed with this.</p>
",https://stackoverflow.com/questions/69807724/playwright-e2e-testing-what-to-do-with-oauth2-or-email-passwordless-authenticat,"['reactjs', 'next.js', 'e2e-testing', 'playwright', 'next-auth']",2048,True,9,2
How to use NgZone in Protractor test for Angular app,"<p>We have an Angular app that uses a very long running HTTP request waiting for events from the server. When testing with Protractor, all related articles (e.g. here: <a href=""https://valor-software.com/articles/testing-with-protractor-how-to-fix-synchronization-issues.html"" rel=""nofollow noreferrer"">https://valor-software.com/articles/testing-with-protractor-how-to-fix-synchronization-issues.html</a> and here: <a href=""https://jarifibrahim.github.io/blog/protractor-and-page-synchronization/"" rel=""nofollow noreferrer"">https://jarifibrahim.github.io/blog/protractor-and-page-synchronization/</a>) suggest running the checks outside the Angular zone, because otherwise Protractor waits for the long HTTP request to finish and eventually times out. However, it is not clear to me, as I haven't found a complete e2e test related to that, how to inject NgZone in a typical Angular Protractor test, consisting of a Page Object and a test (.spec.ts) file, as described here: <a href=""https://coryrylan.com/blog/introduction-to-e2e-testing-with-the-angular-cli-and-protractor"" rel=""nofollow noreferrer"">https://coryrylan.com/blog/introduction-to-e2e-testing-with-the-angular-cli-and-protractor</a>. I tried importing NgZone in the Page Object class constructor as such <code>constructor(private ngZone: NgZone)</code> in a typical Angular component fashion, but this doesn't work. What am I missing?</p>
",https://stackoverflow.com/questions/66989572/how-to-use-ngzone-in-protractor-test-for-angular-app,"['angular', 'protractor']",135,False,0,0
How can I use Cypress to crawl a website for links?,"<p>I understand that Cypress is designed for e2e testing and is not a generic browser automation tool. However, I'm wondering if it's possible to use Cypress to log into a website and crawl through it pulling all the hrefs, thus building a list of the pages you'd like to test.</p>
<p>For a large website, this seems almost necessary for certain kinds of e2e tests, but I'm stuck trying to implement it. Here's what I have:</p>
<pre><code>describe('Link crawler', () =&gt; {
  const linksQueue = ['www.example.com/'];
  const seen = {};

    before(() =&gt; {
      cy.login(email, password);
    });

    // Build a queue, typical BFS algorithm.
    // For all links in the queue, pull out the anchor tags and add new hrefs to the queue.
    // Mark links as seen so you don't infinitely loop.
    while (linksQueue.length) {
      let currentLink = linksQueue.pop();
      it(`${currentLink} should have links.`, () =&gt; {

        cy.visit(`${currentLink}`);

        cy.window().then(win =&gt; {
          let anchorTags = win.document.getElementsByTagName('a');
          for (let idx = 0; idx &lt; anchorTags.length; ++idx) {
            let newLink = anchorTags[idx].href;

            if (!(newLink in seen)) {
              linksQueue.unshift(newLink);
            }
            seen[newLink] = true;
          }
        });
      });
    }
});
</code></pre>
<p>The problem with the above is that Cypress only processes what's in the queue to begin with, so this will run and extract links, but only on 'www.example.com/'.</p>
<p>How can I use Cypress to work over a queue of links that continues to grow? Is there something else I can use besides cy.window?</p>
<p>I've made this work using Puppeteer, but it would be great to use a single library and Cypress is my team's tool of choice for e2e.</p>
",https://stackoverflow.com/questions/67477769/how-can-i-use-cypress-to-crawl-a-website-for-links,"['cypress', 'e2e-testing', 'browser-automation']",820,False,1,0
Ms edge driver rejecting requests,"<p><strong>context:</strong><br />
i'm using robot framework + msedgedriver for e2e testing, my environment is docker in linux vm. So i can't run msedgedriver windows container in this vm.
I decided to run ms edge driver on remote windows vm.</p>
<p><strong>Problem:</strong><br />
in my windows server 2016 i execute the following cmd :   <code>msedgedriver.exe --whitelisted-ips=&quot;&quot;</code>.<br />
I configured my pfsense firewall to redirect trafic to this host, when i try to connect to msedgedriver i get the following error:</p>
<blockquote>
<p>Starting MSEdgeDriver 96.0.1033.0
(87d233ad01b7c17f5f53b7dac130e44d5d4b67d6) on port 9515 All remote
connections are allowed. Use an allowlist instead! Please see
<a href=""https://chromedriver.chromium.org/security-considerations"" rel=""nofollow noreferrer"">https://chromedriver.chromium.org/security-considerations</a> for
suggestions on keeping MSEdgeDriver safe. MSEdgeDriver was started
successfully. [1633362838.713][SEVERE]: Rejecting request with host:
ip_address:9515 address: ip_address</p>
</blockquote>
<p>and I get the following error in the client:</p>
<blockquote>
<p>Host header or origin header is specified and is not whitelisted or
localhost.</p>
</blockquote>
<p>P.S: I've added my IP address to the whitelisted Ips using <em>--whitelisted-ips=''</em> argument also i tried <code>allowed-origins=*</code> but no luck.<br />
Any idea about it?</p>
",https://stackoverflow.com/questions/69440189/ms-edge-driver-rejecting-requests,"['robotframework', 'microsoft-edge', 'e2e-testing', 'windows-server-2016', 'selenium-edgedriver']",464,True,-1,1
Dependancies problem when setting up detox,"<p>I followed official documentation to set up Detox e2e testing framework but am stuck when trying to build with detox build.</p>
<p>Have any of you got this kind of errors?</p>
<p>Detox version 18.21.0</p>
<p>MinSDKVersion 18/21 - tried both</p>
<p>KotlinVersion 1.3.41/1.5.0/1.5.31 - tried all</p>
<blockquote>
<p>Could not resolve androidx.appcompat:appcompat:1.1.0-rc01.
Required by:
project :appCannot find a version of 'androidx.appcompat:appcompat' that satisfies the version constraints:
Dependency path 'mobile:app:unspecified' --&gt; 'androidx.appcompat:appcompat:1.1.0-rc01'
Constraint path 'mobile:app:unspecified' --&gt; 'androidx.appcompat:appcompat:{strictly 1.1.0-rc01}' because of the following reason: debugRuntimeClasspath uses version 1.1.0-rc01
Dependency path 'mobile:app:unspecified' --&gt; 'com.facebook.react:react-native:0.61.5-cometchat.2' --&gt; 'androidx.appcompat:appcompat:1.0.2'
Dependency path 'mobile:app:unspecified' --&gt; 'mobile:react-native-geolocation-service:unspecified' --&gt; 'androidx.appcompat:appcompat:1.0.2'
Dependency path 'mobile:app:unspecified' --&gt; 'mobile:react-native-maps:unspecified' --&gt; 'com.android.support:appcompat-v7:29.0.0' because of the following reasons: OneSignal override, ENABLE_JETIFIER is enabled
Dependency path 'mobile:app:unspecified' --&gt; 'mobile:react-native-push-notification:unspecified' --&gt; 'com.android.support:appcompat-v7:29.0.0' because of the following reasons: OneSignal override, ENABLE_JETIFIER is enabled
Dependency path 'mobile:app:unspecified' --&gt; 'com.wix:detox:0.1.1' --&gt; 'com.google.android.material:material:1.2.1' --&gt; 'androidx.appcompat:appcompat:1.1.0'
Dependency path 'mobile:app:unspecified' --&gt; 'mobile:react-native-image-crop-picker:unspecified' --&gt; 'com.github.yalantis:ucrop:2.2.2-native' --&gt; 'androidx.appcompat:appcompat:1.0.0'
Dependency path 'mobile:app:unspecified' --&gt; 'mobile:react-native-onesignal:unspecified' --&gt; 'com.onesignal:OneSignal:4.5.1' --&gt; 'androidx.appcompat:appcompat:[1.0.0, 1.3.99]'</p>
</blockquote>
",https://stackoverflow.com/questions/69380763/dependancies-problem-when-setting-up-detox,"['react-native', 'detox']",79,False,1,0
how to make cypress wait for a async search with multiple result complete without causing the test to fail,"<p>I have a typical search where the user types some text in an input, async work is done and a table with the results is properly updated.</p>
<p>I have tests that must wait for this search step and then assert business rules regarding the results, like if the table records are eligible for edit.</p>
<p>Every time I ran a complete test battery (something like 80 test files), one or two of the tests involving that search inevitably fail. But if immediately after that, I run the same test alone, the test passes. It's excruciating and makes e2e testing in CI/CD pointless for the project.</p>
<p>I've read the Cypress documentation about flaky tests and searched questions in StackOverflow and GitHub with only complete failure. It's a drama.</p>
<p>Here is one of the tests:</p>
<pre class=""lang-js prettyprint-override""><code>import { searchList } from '../helpers';
import { createFluxoIniciado, randomFluxoNome } from './common';
import { fluxoSelectors } from './selectors';

describe('fluxos finish', () =&gt; {
  it('can manually finish a fluxo INICIADO', () =&gt; {
   // feed data to be searched
    const fluxoNome = randomFluxoNome();
    createFluxoIniciado({ fluxoNome });

    // search
    searchList(fluxoNome);

    // do something with search results
    fluxoSelectors.fluxos.view().click();
    fluxoSelectors.finish().click();
    fluxoSelectors.confirm().click();

   // serach again
    searchList(fluxoNome);
    cy.contains('FINALIZADO');
  });
});
</code></pre>
<p>The code in <code>searchList</code> is where trouble emerge sometimes. It uses the callback strategy recommended <a href=""https://docs.cypress.io/guides/core-concepts/retry-ability#Use-should-with-a-callback"" rel=""nofollow noreferrer"">here</a>. The code attempts to cause retries if not all rows have the searched text.</p>
<pre class=""lang-js prettyprint-override""><code>export function searchList (text) {
  cy.get('#searchText')
    .scrollIntoView()
    .type(text)
    .blur();

  cy.get('tbody tr').should($trs =&gt; {
    $trs.each((i, $tr) =&gt; {
      expect($tr).to.contain(text);
    });
  }, { timeout: 15000 });
}
</code></pre>
<p>Here is an example of a test failure inside a run all test execution:</p>
<p><a href=""https://i.stack.imgur.com/CD6uX.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/CD6uX.png"" alt=""enter image description here"" /></a></p>
",https://stackoverflow.com/questions/69499370/how-to-make-cypress-wait-for-a-async-search-with-multiple-result-complete-withou,"['testing', 'cypress', 'end-to-end']",883,True,1,1
How to use React Testing Library to test for appearance/disappearance of elements in Gutenberg editor using Puppeteer?,"<p>I have the following set up:</p>
<ul>
<li><a href=""https://github.com/WordPress/gutenberg/tree/trunk/packages/e2e-test-utils"" rel=""nofollow noreferrer"">E2E Test Utils</a> - standard WP Gutenberg e2e testing set that uses Jest and Puppeteer</li>
<li><a href=""https://github.com/testing-library/pptr-testing-library"" rel=""nofollow noreferrer"">testing-library/pptr-testing-library</a> - <em>All your favorite user-centric querying functions from @testing-library/react &amp; @testing-library/library available from Puppeteer!</em></li>
</ul>
<p>I'm having a problem testing for appearance and disappearance of elements in the GB editor. I'm now aware that extended assertions don't work with Puppeteer. I just can't figure out what to test for. When I run the test in an interactive mode, I can see that everything is going fine, but I don't get the correct result. The result of the query is just an empty object. Here's a snippet of my code:</p>
<pre class=""lang-js prettyprint-override""><code>import {
    enablePageDialogAccept,
    setBrowserViewport,
    createNewPost,
    openDocumentSettingsSidebar,
    insertBlock,
    loginUser,
} from '@wordpress/e2e-test-utils';

import '@testing-library/jest-dom/extend-expect';
import { getDocument, queries, waitFor } from 'pptr-testing-library';

import { clearPuppeteerBrowser } from '../../../lib/helpers/e2eHelpers';

const {
    getByRole,
    getByLabelText,
    getByDisplayValue,
    getByText,
    queryByLabelText,
    findByRole,
    findByLabelText,
    findByText,
    findAllByText,
} = queries;

describe('CVGB Button block', () =&gt; {
  // Initialize vars within suite's scope
  let $document;
  let $editorSettings;
  let $editorContent;

  // Enable page dialog before running any tests
  beforeAll(async () =&gt; {
    await clearPuppeteerBrowser();
    await loginUser();
    await enablePageDialogAccept();
  });

  // Wait for creating a new post before running each of the tests
  beforeEach(async () =&gt; {
    await createNewPost();
    $document = await getDocument(page);

    // we want to look for Sidebar region only
    $editorSettings = await getByRole($document, 'region', { name: 'Editor settings' });

    // the same for the editor content, so we don't get repeated components from all the document
    $editorContent = await getByRole($document, 'region', { name: 'Editor content' });
  });

  it('should be able to unset a Link when URL is already set', async () =&gt; {
    await insertBlock('CVGB Button');
    await openDocumentSettingsSidebar();

    const $linkButton = await findByRole($document, 'button', {
      name: 'Link',
    });
    await $linkButton.click();

    const $URLInput = await findByRole($document, 'combobox', {
      name: 'URL',
    });
    await $URLInput.click();
    await $URLInput.type('https://www.google.es');
    await $URLInput.press('Enter');

    await waitFor(() =&gt; {
      expect(
        findByLabelText($document, 'Currently selected', {
          exact: false,
        })
      ).toBeInTheDocument();
    });
  });
});
</code></pre>
<p>Here is the error I see:</p>
<p><a href=""https://i.stack.imgur.com/QXz1p.jpg"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/QXz1p.jpg"" alt=""Result of the test above"" /></a></p>
<p>The complete Node error message below the test reads:</p>
<pre><code>(node:41767) UnhandledPromiseRejectionWarning: Error: Protocol error (Runtime.callFunctionOn): Target closed.
    at /Users/my-user/gb-siteapp/public/wp-content/plugins/cv-wp-gb-lib-blocks/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:208:63
    at new Promise (&lt;anonymous&gt;)
    at CDPSession.send (/Users/my-user/gb-siteapp/public/wp-content/plugins/cv-wp-gb-lib-blocks/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:207:16)
    at ExecutionContext._evaluateInternal (/Users/my-user/gb-siteapp/public/wp-content/plugins/cv-wp-gb-lib-blocks/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:200:50)
    at ExecutionContext.evaluateHandle (/Users/my-user/gb-siteapp/public/wp-content/plugins/cv-wp-gb-lib-blocks/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:151:21)
    at /Users/my-user/gb-siteapp/public/wp-content/plugins/cv-wp-gb-lib-blocks/node_modules/pptr-testing-library/lib/index.ts:101:8
    at Generator.next (&lt;anonymous&gt;)
    at /Users/my-user/gb-siteapp/public/wp-content/plugins/cv-wp-gb-lib-blocks/node_modules/pptr-testing-library/dist/index.js:8:71
    at new Promise (&lt;anonymous&gt;)
    at Object.&lt;anonymous&gt;.__awaiter (/Users/my-user/gb-siteapp/public/wp-content/plugins/cv-wp-gb-lib-blocks/node_modules/pptr-testing-library/dist/index.js:4:12)
(node:41767) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 908)
</code></pre>
<h2 id=""edit-in-response-to-caleb-ebys-asnwer-jagx"">EDIT: In response to <a href=""https://stackoverflow.com/a/68473669/1337386"">Caleb Eby's asnwer</a></h2>
<p>I thought that's what the <code>waitFor()</code> is for… however if I add only the <code>await findByLabelText()</code>, I get an error:</p>
<pre><code>SyntaxError: /Users/my-user/gb-siteapp/public/wp-content/plugins/cv-wp-gb-lib-blocks/blocks/button/test/buttonBlock.e2e.spec.js: Unexpected reserved word 'await'. (126:16)
</code></pre>
<p>If I change it to:</p>
<pre class=""lang-js prettyprint-override""><code>        await waitFor(async () =&gt; {
            expect(
                await findByLabelText($document, 'Currently selected', {
                    exact: false,
                })
            ).toBeInTheDocument();
        });
</code></pre>
<p>It takes a very long time to run the test and ends in error:</p>
<pre class=""lang-sh prettyprint-override""><code>    expect(received).toBeInTheDocument()

    received value must be an HTMLElement or an SVGElement.
    Received has type:  object
    Received has value: 
    {
        &quot;_client&quot;: {
            &quot;_callbacks&quot;: [Map],
            &quot;_connection&quot;: [Connection],
            &quot;_sessionId&quot;: &quot;9E13F5776A59D1DD6A177F48A9D1A543&quot;,
            &quot;_targetType&quot;: &quot;page&quot;,
            &quot;emitter&quot;: [Object],
            &quot;eventsMap&quot;: [Map]
        },
        &quot;_context&quot;: {
            &quot;_client&quot;: [CDPSession],
            &quot;_contextId&quot;: 17,
            &quot;_world&quot;: [DOMWorld]
        },
        &quot;_disposed&quot;: false,
        &quot;_frameManager&quot;: {
            &quot;_client&quot;: [CDPSession],
            &quot;_contextIdToContext&quot;: [Map],
            &quot;_frames&quot;: [Map],
            &quot;_isolatedWorlds&quot;: [Set],
            &quot;_mainFrame&quot;: [Frame],
            &quot;_networkManager&quot;: [NetworkManager],
            &quot;_page&quot;: [Page],
            &quot;_timeoutSettings&quot;: [TimeoutSettings],
            &quot;emitter&quot;: [Object],
            &quot;eventsMap&quot;: [Map]
        },
        &quot;_page&quot;: {
            &quot;_accessibility&quot;: [Accessibility],
            &quot;_client&quot;: [CDPSession],
            &quot;_closed&quot;: false,
            &quot;_coverage&quot;: [Coverage],
            &quot;_emulationManager&quot;: [EmulationManager],
            &quot;_fileChooserInterceptors&quot;: [Set],
            &quot;_frameManager&quot;: [FrameManager],
            &quot;_javascriptEnabled&quot;: true,
            &quot;_keyboard&quot;: [Keyboard],
            &quot;_mouse&quot;: [Mouse],
            &quot;_pageBindings&quot;: [Map],
            &quot;_screenshotTaskQueue&quot;: [ScreenshotTaskQueue],
            &quot;_target&quot;: [Target],
            &quot;_timeoutSettings&quot;: [TimeoutSettings],
            &quot;_touchscreen&quot;: [Touchscreen],
            &quot;_tracing&quot;: [Tracing],
            &quot;_viewport&quot;: [Object],
            &quot;_workers&quot;: [Map],
            &quot;emitter&quot;: [Object],
            &quot;eventsMap&quot;: [Map]
        },
        &quot;_remoteObject&quot;: {
            &quot;className&quot;: &quot;HTMLDivElement&quot;,
            &quot;description&quot;: &quot;div.block-editor-link-control__search-item.is-current&quot;,
            &quot;objectId&quot;: &quot;-193265238525024879.17.113&quot;,
            &quot;subtype&quot;: &quot;node&quot;,
            &quot;type&quot;: &quot;object&quot;
        }
    }
</code></pre>
<p>This actually has a possible culprit of a solution, but what is the right way of testing for this (instead of <code>toBeInTheDocument()</code>)?</p>
",https://stackoverflow.com/questions/68464885/how-to-use-react-testing-library-to-test-for-appearance-disappearance-of-element,"['puppeteer', 'e2e-testing', 'gutenberg-blocks', 'testing-library']",980,True,0,1
How to use Cypress.io for E2E testing when back end and front end are in separate repos?,"<p>I have a project with a NextJS front end and a FeathersJS/Node back end. Both of these apps/codebases are separate repos. I would like to start using Cypress for E2E testing, but I'm not sure what the best approach is to do that with my set up. Ideally, the tests would run as part of CI for every back end AND front end change. I am currently using GitHub actions for my CI, I'm not sure if that would help or hurt me here.</p>
<p>I've seen some people mention putting Cypress in its own repo with its own docker-compose that would handle spinning up the front end and back end to run the tests. However, I don't understand how this would work as part of CI. How would new code, pre-merge, make its way into this repo to run as part of CI? I think there would be a lot of issues with this approach.</p>
<p>One approach I thought of is to just include Cypress as part of the front end NextJS app and have it run against a &quot;staging&quot; or &quot;test&quot; instance of the back end that gets seeded with every new back end deploy. One of the issues here is that the tests would not run when the back end changes, but that's not necessarily an issue, I suppose.</p>
<p>Any thoughts?</p>
",https://stackoverflow.com/questions/67131004/how-to-use-cypress-io-for-e2e-testing-when-back-end-and-front-end-are-in-separat,"['node.js', 'testing', 'next.js', 'devops', 'cypress']",551,False,5,0
Extract a specific value from an output stream in bash,"<p>I have this command:</p>
<pre><code>`curl -X POST https://server.domain.com/v2/jobs/$job_ID/runs?project_id=$project_ID -H &quot;Content-Type: application/json&quot; -H &quot;Authorization: Bearer ${token}&quot;  -d &quot;{ \&quot;job_run\&quot;: {} }&quot;
</code></pre>
<p>and it gives this output</p>
<blockquote>
<p>quote
Response from job execution is {&quot;metadata&quot;:{&quot;rov&quot;:{&quot;mode&quot;:0,&quot;collaborator_ids&quot;:{}},&quot;project_id&quot;:&quot;aff59748-260a-476e-9578-b4f4a93e7a92&quot;,&quot;sandbox_id&quot;:&quot;aff59748-260a-476e-9578-b4f4a93e7a92&quot;,&quot;usage&quot;:{&quot;last_updated_at&quot;:&quot;2021-02-12T00:31:19Z&quot;,&quot;last_updater_id&quot;:&quot;1000331040&quot;,&quot;last_update_time&quot;:1613089879840,&quot;last_accessed_at&quot;:&quot;2021-02-12T00:31:19Z&quot;,&quot;last_access_time&quot;:1613089879840,&quot;last_accessor_id&quot;:&quot;1000331040&quot;,&quot;access_count&quot;:0},&quot;name&quot;:&quot;Notebook Job&quot;,&quot;description&quot;:&quot;&quot;,&quot;tags&quot;:[],&quot;asset_type&quot;:&quot;job_run&quot;,&quot;origin_country&quot;:&quot;us&quot;,&quot;rating&quot;:0,&quot;total_ratings&quot;:0,&quot;catalog_id&quot;:&quot;d47cd45c-0161-4b89-ba4f-c0e48272f08e&quot;,&quot;created&quot;:1613089879840,&quot;created_at&quot;:&quot;2021-02-12T00:31:19Z&quot;,&quot;owner_id&quot;:&quot;1000331040&quot;,&quot;size&quot;:0,&quot;version&quot;:2,&quot;asset_state&quot;:&quot;available&quot;,&quot;asset_attributes&quot;:[&quot;job_run&quot;],<strong>&quot;asset_id&quot;:&quot;5d9dae4e-0dfe-4e53-9e56-18a4bb44af&quot;</strong>,&quot;asset_category&quot;:&quot;USER&quot;},&quot;entity&quot;:{&quot;job_run&quot;:{&quot;job_ref&quot;:&quot;28723316-9373-44ba-9229-7c796f21b099&quot;,&quot;job_name&quot;:&quot;Dummy Job for E2E Testing&quot;,&quot;job_type&quot;:&quot;notebook&quot;,&quot;state&quot;:&quot;Starting&quot;,&quot;isScheduledRun&quot;:false,&quot;configuration&quot;:{&quot;env_id&quot;:&quot;jupconda37-aff59748-260a-476e-9578-b4f4a93e7a92&quot;,&quot;version&quot;:&quot;ca0b9a58-ba0d-4d28-93d5-3cdc66a5b137&quot;,&quot;env_type&quot;:&quot;notebook&quot;,&quot;env_variables&quot;:[],&quot;job_manager_id&quot;:&quot;9268a8a8-72e4-47a1-a851-65f38d8284ce&quot;,&quot;notebook_job_output&quot;:{},&quot;command_line_arguments&quot;:[]},&quot;project_name&quot;:&quot;Tahoe Migration&quot;}},&quot;href&quot;:&quot;/v2/assets/5d9dae4e-0dfe-4e53-9e56-ee18a4bb44af?project_id=aff59748-260a-476e-9578-b4f4a93e7a92&quot;}</p>
</blockquote>
<p>I want to extract the value of <strong>asset_id</strong> from the output stream and store it in a variable within shell script. I tried storing the response in a bash variable and tried to parse with awk, it didn't work. Could one of you please provide me an idea as to how to go about this?</p>
<p>Thank you</p>
",https://stackoverflow.com/questions/66166727/extract-a-specific-value-from-an-output-stream-in-bash,"['bash', 'curl']",49,True,0,2
Does Prettier have a way to specifically ignore certain lines of code in a file?,"<p>We are using TestCafe for our E2E testing purposes and wanted to implement a formatter so all contributors push the same style code up. I have Prettier up and running and have some config rules in place, but we are seeing some wonkiness that I think is because of how TestCafe likes to be written.</p>
<p>I understand formatters are opinionated and each line could react differently, but the gist is something like: Does Prettier have a way to add a regex or something to tell it to ignore certain syntax?</p>
<p>For example, in TestCafe, when writing a test, you can add .meta, .before, .after before the actual test title and function. Doing so and then formatting, Prettier might connect .meta.before.after all together. Same thing happens with the fixture and .page before defining tests.</p>
<p>How we'd want it (based on configs):</p>
<pre><code>fixture`dev_tests`
    .page`www.sampleurl.com`

test
    .meta({
        createdOn: '08/25/21',
        createdBy: 'Bob Barley',
        updatedOn: '08/26/21',
        updatedBy: 'Bob Barley',
    })
    .meta({ scope: 'functional', priority: 'high', showstopper: 'yes' })
    ('Sample_test_title', async (t) =&gt; {
        await t.click()
    })
</code></pre>
<p>How Prettier formats it:</p>
<pre><code>fixture`dev_tests`.page`www.sampleurl.com`

test
    .meta({
        createdOn: '08/25/21',
        createdBy: 'Bob Barley',
        updatedOn: '08/26/21',
        updatedBy: 'Bob Barley',
    })
    .meta({ scope: 'functional', priority: 'high', showstopper: 'yes' })(
    'Sample_test_title',
    async (t) =&gt; {
        await t.click()
    }
)
</code></pre>
<p>We'd like to know if there's something we could build out in a config file or something to say &quot;If the next character is a . after the word 'fixture', don't format until the word 'test'.&quot; And the same for &quot;If the next character is a ( after the character ), don't format.&quot; So on and so forth.</p>
<p>Current configs for Prettier:</p>
<pre><code>{
    &quot;arrowParens&quot;: &quot;always&quot;,
    &quot;bracketSpacing&quot;: true,
    &quot;embeddedLanguageFormatting&quot;: &quot;auto&quot;,
    &quot;endOfLine&quot;: &quot;lf&quot;,
    &quot;insertPragma&quot;: false,
    &quot;parser&quot;: &quot;babel&quot;,
    &quot;printWidth&quot;: 80,
    &quot;proseWrap&quot;: &quot;always&quot;,
    &quot;quoteProps&quot;: &quot;as-needed&quot;,
    &quot;semi&quot;: false, 
    &quot;singleQuote&quot;: true,
    &quot;tabWidth&quot;: 4,
    &quot;trailingComma&quot;: &quot;es5&quot;,
    &quot;useTabs&quot;: true
}
</code></pre>
<p>We've already implemented a .prettierignore file and have tried //prettier-ignore within the file, but that just ignores the entire test node. The comment doesn't seem to work if you plug it in where you want Prettier to skip.</p>
",https://stackoverflow.com/questions/68940356/does-prettier-have-a-way-to-specifically-ignore-certain-lines-of-code-in-a-file,"['javascript', 'testing', 'testcafe', 'prettier', 'formatter']",1004,False,0,0
"Jest testing DTO decorators. Fails in Jest SPEC file, but works via Postman","<p>Test case works in Postman, but not from Visual Studio Code or Jest command line.</p>
<p>Request Body in Postman that works and returns all 4 errors:</p>
<pre><code>{ &quot;Item&quot;: {} }
</code></pre>
<p>This is missing the FileName and Item.Data fields.</p>
<p>API.dto.ts</p>
<pre><code>import { Type } from 'class-transformer';
import { IsNumberString, IsString, MinLength, ValidateNested } from 'class-validator';

// Expected Payload
// {
//  FileName: 'abc',
//  Item: {
//      Data: '123'
//  }
// }

export class ItemDataDTO {
    @IsNumberString() @MinLength(2) public readonly Data: string;
}
/**
 * This class is the Data Object for the API route
 */
export class ApiDTO {
    @IsString() @MinLength(1) public readonly FileName: string;

    @ValidateNested()
    @Type(() =&gt; ItemDataDTO)
    Item: ItemDataDTO;
}
</code></pre>
<p>api.controller.ts</p>
<pre><code>import { Body, Controller, Get, Options, Put, Request, Response } from '@nestjs/common';
import { ApiDTO } from './api.dto';

@Controller('api')
export class ApiController {
    constructor() { }

    @Put('donotuse')
    public DoNotUse(@Body() APIBody: ApiDTO) {
        return 'OK';
    }
}
</code></pre>
<p>API.dto.spec.ts</p>
<pre><code>import { ArgumentMetadata, ValidationPipe } from '@nestjs/common';
import { ApiDTO } from './api.dto';

describe('ApiDto', () =&gt; {
    it('should be defined', () =&gt; {
        expect(new ApiDTO()).toBeDefined();
    });

    it('should validate the ApiDTO definition', async () =&gt; {
        const target: ValidationPipe = new ValidationPipe({
            transform: true,
            whitelist: true,
        });
        const metadata: ArgumentMetadata = {
            type: 'body',
            metatype: ApiDTO,
            data: '{ &quot;Item&quot;: {} }',
        };
        const Expected: string[] = [
            'FileName must be longer than or equal to 1 characters',
            'FileName must be a string',
            'Item.Data must be longer than or equal to 2 characters',
            'Item.Data must be a number string',
        ];
        await target.transform(&lt;ApiDTO&gt;{}, metadata).catch((err) =&gt; {
            expect(err.getResponse().message).toEqual(Expected);
        });
    });
});
</code></pre>
<p>The expect fails.</p>
<pre><code>await target.transform(&lt;ApiDTO&gt;{}, metadata).catch((err) =&gt; { 
    expect(err.getResponse().message).toEqual(Expected);
});
</code></pre>
<p>The 2 FileName errors are returned, but no the Item.Data fields.  Setting <code>data: '',</code> to be <code>data: '{ &quot;Item&quot;: {} }'</code> also fails the same way.</p>
<p>Actual expectation failure:</p>
<pre><code>expect(received).toEqual(expected) // deep equality
    - Expected  - 2
    + Received  + 0

  Array [
    &quot;FileName must be longer than or equal to 1 characters&quot;,
    &quot;FileName must be a string&quot;,
-   &quot;Item.Data must be longer than or equal to 2 characters&quot;,
-   &quot;Item.Data must be a number string&quot;,
  ]
</code></pre>
<p>This is indicating that the FileName validation is there, those 2 lines are returned, but the Item.Data errors, are not coming back, and are 'extra' in my test case results.</p>
<p>However, calling this via Postman, PUT /api/donotuse with the request body:</p>
<pre><code>{ &quot;Item&quot;: {} }
</code></pre>
<p>returns all 4 of the errors. The HTTP Status code is also a 400 Bad Request, as NestJS would normally return on its own.  I am not sure what is wrong in my test case to get the errors to all be returned.</p>
<p><strong>EDIT</strong>
I have also then tried to do this via E2E testing as the answer suggested, but I still receive the same missing errors.</p>
<pre><code>describe('ApiDto - E2E', () =&gt; {
    let app: INestApplication;

    afterAll(async () =&gt; {
        await app.close();
    });

    beforeAll(async () =&gt; {
        const moduleFixture: TestingModule = await Test.createTestingModule({
            imports: [AppModule],
        }).compile();

        app = moduleFixture.createNestApplication();
        app.useGlobalPipes(new ValidationPipe({ transform: true, errorHttpStatusCode: HttpStatus.UNPROCESSABLE_ENTITY }));
        await app.init();
    });

    it('should validate the ApiDTO definition', async () =&gt; {
        const APIRequestDTO: unknown = { FileName: null, Item: {} };
        const ResponseData$ = await request(app.getHttpServer())
            .put('/api/donotuse')
            .set('Accept', 'application/json')
            .send(APIRequestDTO as ApiDTO);

        const Expected: string[] = [
            'FileName must be longer than or equal to 1 characters',
            'FileName must be a string',
            'Item.Data must be longer than or equal to 2 characters',
            'Item.Data must be a number string',
        ];

        expect(ResponseData$.status).toBe( HttpStatus.UNPROCESSABLE_ENTITY);
        expect(ResponseData$.body.message).toBe(Expected);
    });
});
</code></pre>
<p>This still does not provide all the errors, that are properly returned from the Postman call.  I am not sure what is happening during testing that the sub type is not processed.  Calling this via Postman, same body, same headers, etc., does return the proper errors:</p>
<p>&quot;message&quot;: [
&quot;FileName must be longer than or equal to 1 characters&quot;,
&quot;FileName must be a string&quot;,
&quot;Item.Data must be longer than or equal to 2 characters&quot;,
&quot;Item.Data must be a number string&quot;
],</p>
<p>I know it is going into the ValidationPipe as well, as my custom error code, 422 Unprocessable Entity is returned, indicating this is the validation that is failing.  This same error is returned in both my unit test and the E2E test, but not the second set of errors about Item.Data.</p>
",https://stackoverflow.com/questions/69620040/jest-testing-dto-decorators-fails-in-jest-spec-file-but-works-via-postman,"['unit-testing', 'testing', 'jestjs', 'nestjs', 'class-validator']",1702,True,2,1
"How to use webdirverio in typescript project, or please provide high level overview of how to refer to types defined in imported packages","<p><strong>This is the specific case I've been working on</strong>, below it, further down, is the original more general question.</p>
<ul>
<li><p>I'm trying to create a private npm package for e2e testing of a website.</p>
</li>
<li><p>I need to use the <code>webdriverio</code> package.</p>
</li>
<li><p>I want the user to be able to start my executable with a provided configuration, one part of this configuration must be a <code>webdriverio</code> config (actually a subset of it, since I'd like to restrict some options). The other part of the configuration is related to my package: user login name etc.</p>
</li>
</ul>
<p>To achieve this, I've declared my own type and expect the user's argument to conform to it.</p>
<p>But the problem is that when I try to compile the code, which declares that type, I get errors like:</p>
<p><code>Argument of type '{ … } is not assignable to parameter of type 'RemoteOptions'</code></p>
<p><code>Types of property 'logLevel' are incompatible</code></p>
<p><code>Type 'string' is not assignable to type 'WebDriverLogTypes | undefined'.</code></p>
<p>The code, which declares that type is (I left the comments just to demonstrate attempts I'd tried to fix this):</p>
<pre><code>//import { WebdriverIO } from '@wdio/types';

type TestUserConfig = {
  //wdioConfig: WebdriverIO,
  wdioConfig: {
    path: '/wd/hub',
    automationProtocol: 'webdriver',
    //logLevel: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent',
    logLevel: string,
    waitforTimeout: number,
    capabilities: {
      browserName: 'chrome',
    },
  },
  domain: string,
  userLogin: string,
  userPassword: string,
  googleAuthSecret: string,
  expectedRole: string,
}

export type {
  TestUserConfig,
}
</code></pre>
<p>The problem is that if I try to refer to those webdriverio types directly, like:</p>
<pre><code>logLevel: WebDriverLogTypes,
</code></pre>
<p>I get errors like <code>Cannot find name 'WebDriverLogTypes'</code></p>
<p>If I try to import that type like:</p>
<pre><code>import {WebDriverLogTypes} from '@wdio/types';
</code></pre>
<p>I ger errors like: <code>Module '&quot;@wdio/types&quot;' has no exported member 'WebDriverLogTypes'</code></p>
<hr />
<p><strong>The original question:</strong></p>
<p>Suppose there is a nodejs package (I won't call it module, since I mean a module, but not a module of mine, which is under my control, but a module installed via <code>npm</code>). That package exports a function, which expects certain type as its argument:</p>
<pre><code>type Foo = 'foo';
export default function otherModule(arg: Foo) {}
</code></pre>
<p>Now, when I use this module, I want typescript to correctly catch type errors, so that an attempt to compile this TypeScript code throws an error:</p>
<pre><code>import otherModule from 'other-module';
otherModule('bar');
</code></pre>
<p>What would be the commonly accepted (probably the best) approach to achieve this?</p>
<hr />
<p>I've seen some packages have '@types/*' packages too, but I haven't been able to figure out how to use them.</p>
",https://stackoverflow.com/questions/69497355/how-to-use-webdirverio-in-typescript-project-or-please-provide-high-level-overv,"['javascript', 'node.js', 'typescript', 'types', 'webdriver-io']",483,False,2,1
Cypress complains on a Webpack build of Pdfjs-dist which works in development,"<p>I have been using an npm installed version of <code>pdfjs-dist</code> for a few weeks now, in a Webpack ES6 environment (details of its workings <a href=""https://stackoverflow.com/questions/63553008/looking-for-help-to-make-npm-pdfjs-dist-work-with-webpack-and-django"">in this older SO question</a>, updated today), where E2E testing is performed with Cypress. Yesterday Cypress stopped working.</p>
<p>The strange thing is the Cy error:</p>
<pre><code>Error: Webpack Compilation Error
./node_modules/pdfjs-dist/build/pdf.worker.js (./node_modules/worker-loader/dist/cjs.js?esModule=false&amp;filename=[name].js!./node_modules/pdfjs-dist/build/pdf.worker.js)
Module build failed (from ./node_modules/worker-loader/dist/cjs.js):
TypeError: Cannot read property 'tap' of undefined
 @ ./node_modules/pdfjs-dist/webpack.js 19:20-100
 @ ./src/js/select/views/pdfViews.js
 @ ./src/js/select/views/navbarViews.js
 @ ./src/js/select/utils/DOMutils.js
 @ ./src/js/common/texts/navbars/selectTxt.js
 @ ./cypress/support/KJIcommands/skipRep.js
 @ ./cypress/integration/step1/301-show--lists.spec.js
    at Watching.handle [as handler] (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:176:23)
    at /home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Watching.js:99:9
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/HookCodeFactory.js:33:10), &lt;anonymous&gt;:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/Hook.js:154:20)
    at Watching._done (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Watching.js:98:28)
    at /home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Watching.js:73:19
    at Compiler.emitRecords (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:499:39)
    at /home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Watching.js:54:20
    at /home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:485:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/HookCodeFactory.js:33:10), &lt;anonymous&gt;:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/Hook.js:154:20)
    at /home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/webpack/lib/Compiler.js:482:27
    at /home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/neo-async/async.js:2818:7
    at done (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/neo-async/async.js:3522:9)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/HookCodeFactory.js:33:10), &lt;anonymous&gt;:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/giampaolo/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/tapable/lib/Hook.js:154:20)
</code></pre>
<p>Cypress seems to point at an error in Webpack, as if compiling the code did not work fine, yet the applications shows no sign of suffering, and this is its compiling report:</p>
<pre><code>&gt; webpack-dev-server --mode development

ℹ ｢wds｣: Project is running at http://localhost:8080/
ℹ ｢wds｣: webpack output is served from /
ℹ ｢wds｣: Content not from webpack is served from ./dist
(node:55249) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
        Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
        Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
ℹ ｢wdm｣: assets by path *.js 4.07 MiB
  asset pdf.worker.js 1.7 MiB [emitted]
  asset select.js 1.19 MiB [emitted] (name: select)
  asset show.js 1.18 MiB [emitted] (name: show)
assets by path ../../../templates/docs/*.html 29.4 KiB
  asset ../../../templates/docs/dist-select.html 16.8 KiB [emitted]
  asset ../../../templates/docs/dist-show.html 12.6 KiB [emitted]
runtime modules 4.2 KiB 14 modules
modules by path ./src/js/ 286 KiB
  modules by path ./src/js/show/ 79.3 KiB 41 modules
  modules by path ./src/js/select/ 194 KiB 31 modules
  modules by path ./src/js/common/ 12.2 KiB 4 modules
modules by path ./node_modules/ 713 KiB
  cacheable modules 713 KiB 30 modules
  ./node_modules/webpack/hot/ sync nonrecursive ^\.\/log$ 170 bytes [built] [code generated]
  ./node_modules/worker-loader/dist/cjs.js?esModule=false&amp;filename=[name].js!./node_modules/pdfjs-dist/build/pdf.worker.js 106 bytes [not cacheable] [built] [code generated]
canvas (ignored) 15 bytes [built] [code generated]
fs (ignored) 15 bytes [built] [code generated]
zlib (ignored) 15 bytes [optional] [built] [code generated]
http (ignored) 15 bytes [built] [code generated]
https (ignored) 15 bytes [built] [code generated]
url (ignored) 15 bytes [built] [code generated]
webpack 5.49.0 compiled successfully in 3598 ms
ℹ ｢wdm｣: Compiled successfully.
</code></pre>
<p>I have been looking around for a few hours now, but could not find a hint. Would really appreciate some pointers.</p>
<p>The only solution I saw repeatedly would seem to try and revert to older <code>pdfjs</code> versions, and in case I have no other one I may try that one. I am not inclined though, because it has been working flawlessly for some time and it seems more of a Cypress issue than a Webpack/pdfjs one, and the code keeps working smoothly. Yet I need my tests too :P</p>
<p>Thanks in advance.</p>
<p><strong>Edit</strong>:
I went back a couple of commits, where code was still testing properly, and the first commit showing an error had a different one:</p>
<pre><code>An uncaught error was detected outside of a testfailed
No commands were issued in this test.
TypeError
The following error originated from your test code, not from Cypress.

  &gt; Cannot read property 'dataset' of null

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.
src/js/show/utils/base-show.js:31:49
  29 | export const showElements = {
  30 | 
&gt; 31 |   myPdfDoc: document.querySelector('#script-1').dataset.mypdfdoc,
     |                                                 ^
  32 | 
  33 | }
  34 |  
View stack trace
 Print to console
    at Object../src/js/show/utils/base-show.js (webpack:///./src/js/show/utils/base-show.js:31:49)
    at __webpack_require__ (webpack:///webpack/bootstrap:19:1)
    at Object../src/js/show/UI/selections.js (webpack:///./src/js/show/UI/selections.js:1:1)
    at __webpack_require__ (webpack:///webpack/bootstrap:19:1)
    at Object../src/js/common/texts/navbars/selectTxt.js (webpack:///./src/js/common/texts/navbars/selectTxt.js:3:1)
    at __webpack_require__ (webpack:///webpack/bootstrap:19:1)
    at Object../cypress/support/KJIcommands/skip.js (webpack:///./cypress/support/KJIcommands/skip.js:1:1)
    at __webpack_require__ (webpack:///webpack/bootstrap:19:1)
    at Object../cypress/support/commands.js (webpack:///./cypress/support/commands.js:32:1)
    at __webpack_require__ (webpack:///webpack/bootstrap:19:1)
From previous event:
    at runScriptsFromUrls (http://localhost:34631/__cypress/runner/cypress_runner.js:164932:98)
    at Object.runScripts (http://localhost:34631/__cypress/runner/cypress_runner.js:164946:11)
    at $Cypress.onSpecWindow (http://localhost:34631/__cypress/runner/cypress_runner.js:153894:19)
</code></pre>
<p>This second kind of error has in common with the first one that no code from the tests is executed, it is generated <em>before even trying</em>. It says it &quot;dynamically generated a test&quot; to show a failure, but if it didn't visit the app it seems obvious it could not find a DOM element, no?</p>
<p>This came up in the console, although it might not be relevant. It should be connected to a Firefox error with source maps, which I see often during development:</p>
<pre><code>DevTools failed to load source map: Could not load content for http://localhost:34631/__cypress/runner/popper.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
</code></pre>
",https://stackoverflow.com/questions/68914580/cypress-complains-on-a-webpack-build-of-pdfjs-dist-which-works-in-development,"['webpack', 'cypress', 'pdf.js']",991,True,2,1
