title,body,link,tags,view_count,is_answered,score,answer_count
E2E Testing NestJS,"<p>Im new to NestJS and im trying to setup my end to end testing. It does not throw any errors but the request always returns 404.
The test look like this:</p>
<pre><code>import { CreateProductDto } from './../src/products/dto/create-product.dto';
import { ProductsModule } from './../src/products/products.module';
import { Product } from './../src/products/entities/product.entity';
import { Repository } from 'typeorm';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { createTypeOrmConfig } from './utils';
import { Test, TestingModule } from '@nestjs/testing';
import { TypeOrmModule } from '@nestjs/typeorm';

describe('ProductsController (e2e)', () =&gt; {
  let app: INestApplication;
  let productRepository: Repository&lt;Product&gt;;

  beforeEach(async () =&gt; {
    const config = createTypeOrmConfig();

    const moduleFixture: TestingModule = await Test.createTestingModule({
      imports: [
        TypeOrmModule.forRoot(config),
        TypeOrmModule.forFeature([Product]),
        ProductsModule,
      ],
    }).compile();

    app = moduleFixture.createNestApplication();
    productRepository = moduleFixture.get('ProductRepository');

    await app.init();
  });

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

  it('create', async () =&gt; {
    // Arrange
    const createProductDto = new CreateProductDto();
    createProductDto.name = 'testname';
    createProductDto.description = 'testdescription';
    createProductDto.price = 120;
    createProductDto.image = 'testimage';

    // Act
    const response = await request(app.getHttpServer())
      .post(`/api/v1/products`)
      .send(createProductDto);

    // Assert
    expect(response.status).toEqual(201);
  });
});
</code></pre>
<p>I expected it to returns a 201 response. I tried more routes and same as before.</p>
<p><img src=""https://i.stack.imgur.com/iUBey.png"" alt=""enter image description here"" /></p>
",https://stackoverflow.com/questions/73758195/e2e-testing-nestjs,"['nestjs', 'supertest']",854,True,-1,1
E2E testing with JWT guard,"<p>I’m trying to get e2e testing to work for this user update function. When user logs in their id and email are saved into JWT token and stored in HttpOnly Cookie. My problem is how to get this token so that it passes through JWT guard, gets id from JWT token and updates correct user. Because currently i'm obviously getting <code>Unauthorized</code> message.</p>
<p><strong>user.2e2-spec.ts</strong></p>
<pre><code>const mockUser: UpdateUserDto = {
  email: 'updateEmail@gmail.com',
  first_name: 'first_name1',
  last_name: 'last_name1',
  password: 'password1',
};

const mockLoginUser: LoginUserDto = {
  email: 'email@gmail.com',
  password: 'password',
};

describe('Auth controller (e2e)', () =&gt; {
  let app: INestApplication;

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

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

  it('should update user info', async () =&gt; {
    const loginRes = await request(app.getHttpServer())
      .post('/login')
      .send(mockLoginUser);

    const data = await request(app.getHttpServer())
      .put('/me/update')
      .send(mockUser)
      .expect('success');
  });

  afterAll(async () =&gt; {
    await app.close();
  });
});
</code></pre>
<p><strong>user.controller.ts</strong></p>
<pre><code>  @UseGuards(jwtAuthGuard)
  @Put('me/update')
  async updateUser(@Req() request, @Body() updateUser: UpdateUserDto) {
    const data = await this.userService.updateUser(request.user.id, updateUser);
    return data;
  }
</code></pre>
<p><strong>jwt.strategy.ts</strong></p>
<pre><code>@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
  constructor() {
    super({
      jwtFromRequest: (req) =&gt; {
        var token = null;
        if (req &amp;&amp; req.cookies) {
          token = req.cookies['jwt'];
        }
        return token;
      },
      ignoreExpiration: false,
      secretOrKey: process.env.ACCESS_SECRET,
    });
  }

  async validate(payload: any) {
    return {
      id: payload.id,
      email: payload.email,
    };
  }
}
</code></pre>
",https://stackoverflow.com/questions/72049217/e2e-testing-with-jwt-guard,"['nestjs', 'e2e-testing', 'nestjs-testing']",1806,False,1,1
nestjs e2e testing no logger output,"<p>I am using default built-in logger in NestJS form simple logging during development. But when I run e2e tests there is no logger output on console. A really need this, to see what is happening when test fails.
Snippet from package.json:</p>
<p><code> &quot;test:e2e&quot;: &quot;jest --config ./test/jest-e2e.json&quot;</code></p>
<p>And jest-e2e.json:</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;
  },
  &quot;verbose&quot;: true
}
</code></pre>
",https://stackoverflow.com/questions/71677866/nestjs-e2e-testing-no-logger-output,"['logging', 'nestjs', 'e2e-testing']",1867,True,3,3
E2E Testing- click on specific button,"<p>I have a button, it looks like this in HTML form</p>
<pre><code>&lt;span class=&quot;v-btn__content&quot;&gt;Create&lt;/span&gt;
</code></pre>
<p>My E2E Test, I am trying to click that <code>Create</code> button</p>
<pre><code>module.exports = {
    'My first test case'(browser) {
        browser

        .url('http://localhost:8080/#/')

        .waitForElementVisible('#app')
        .waitForElementVisible('#input-10')
        .waitForElementVisible('#input-13')
        .setValue('#input-10', 'jdoe@email.com')
        .setValue('#input-13', '**')
        .click('.v-btn__content')
        .assert.textContains('.v-toolbar__title','App')
        .waitForElementVisible('.v-data-footer__pagination')
        .waitForElementVisible('.v-btn__content')
        .assert.textContains('.v-btn__content','Create')
        .click('.v-btn__content','Create')  ❌
        
    }
}
</code></pre>
<p>I got</p>
<blockquote>
<p>✖ Testing if element &lt;.v-btn__content&gt; contains text 'Create' in 5000ms - expected &quot;contains text 'Create'&quot; but got: &quot;does not contain 'Create'&quot; (5219ms)</p>
</blockquote>
",https://stackoverflow.com/questions/72104345/e2e-testing-click-on-specific-button,"['vue.js', 'vuejs2', 'e2e-testing', 'nightwatch.js', 'e2e']",241,True,2,1
Headful Github Actions for e2e testing,"<p>I'm trying to e2e test my chrome extension with Github actions. I'm using Playwright framework. For Chrome extensions to work it is required to run the tests headful. Locally it is running fine, but when I push a commit, the github action fails</p>
<p><a href=""https://i.stack.imgur.com/lzAQx.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/lzAQx.png"" alt=""enter image description here"" /></a></p>
<p>I tried the following command to increase verbosity and to setup a display</p>
<pre><code>$&gt; Xvfb :99 &amp; node --trace-deprecation ./node_modules/.bin/playwright test
</code></pre>
<p>But it fails. The output is not more than just</p>
<pre><code>Running 1 test using 1 worker
××F

  1 failed
    [chromium] › src/app.spec.ts:6:3 › Popup › our extension loads =================================
Error: Process completed with exit code 1.
</code></pre>
<p>Is something like this even possible or should I use something like Browserstack for this?</p>
",https://stackoverflow.com/questions/72424011/headful-github-actions-for-e2e-testing,"['github-actions', 'e2e-testing', 'playwright', 'browserstack']",317,False,0,1
SQLAlchemy use Transactions for E2E Testing,"<p>I am writing E2E tests for our software and would like to figure out why the <code>rollback</code> call does not roll the DB back to the state when the test started.</p>
<p>I use a decorator for my pytest test functions.</p>
<p>The issue I get is that data that I write to the DB during the tests persists, even though I call the <code>rollback()</code> in the <code>final</code> statement. Which indicates that the <code>transaction</code> is not setup or SQLAlchemy is doing something else in the background.</p>
<p>I see SQLAlchemy has the <a href=""https://docs.sqlalchemy.org/en/14/orm/session_transaction.html#using-savepoint"" rel=""nofollow noreferrer"">SAVEPOINT</a> feature but I am not sure if this is what I really need. I think my request is pretty simple yet the framework obfuscates it. Or simply that I am not too experienced with it...</p>
<p>Note - the functions tested can have multiple commit calls...</p>
<pre><code>def get_postgres_db():
    
    v2_session = sessionmaker(
        autocommit=False,
        autoflush=False,
        bind=v2_engine
    )
    
    try:
        yield v2_session
    finally:
        v2_session.close()

def postgres_test_decorator(test_function):
    &quot;&quot;&quot;
    Decorator to open db connection and roll back regardless of test outcome
    Can be ported into pytest later
    &quot;&quot;&quot;

    def the_decorator(*args, **kwargs):

        try:
            postgres_session = list(get_postgres_db())[0]

            # IN MY SQL MIND I WOULD LIKE TO DO HERE 

            # BEGIN TRANSACTION

            test_function(postgres_session)

        finally:
            # THIS SHOULD ROLLBACK TO ORIGINAL STATE

            # ROLLBACK
            postgres_session.rollback()

    return the_decorator
</code></pre>
",https://stackoverflow.com/questions/73695103/sqlalchemy-use-transactions-for-e2e-testing,"['python', 'python-3.x', 'sqlalchemy']",47,False,0,0
Node.js E2E Testing for Authenticated Routes,"<p>I am writing e2e tests using Jest for a Node.js (Nest) application.</p>
<p>A sample test for user registration look like this:</p>
<pre><code>describe('User Registration', () =&gt; {
    it('handles creation of a user account', async () =&gt; {
      parentData = createUser();

      const response = await request(app.getHttpServer()).post('/auth/register').send(parentData);
      expect(response.statusCode).toBe(201);
      expect(response.body).toBeDefined();
      token = response.body;
      accessToken = token.accessToken;
      refreshToken = token.refreshToken;
      expect(accessToken).toBeDefined();
      expect(refreshToken).toBeDefined();
    });
  }
</code></pre>
<p>As I am trying to test other parts of the application, I am faced with a problem: to test parts that need a user to be authenticated, I need to log in first. As I am creating tests in different files I have no guarantee that a user will have been created before running those files. How can I have a condition where I can run the registration first, and then the remaining of the tests. Or alternatively, import this part of the test in other tests.</p>
",https://stackoverflow.com/questions/73973937/node-js-e2e-testing-for-authenticated-routes,"['node.js', 'jestjs', 'nest', 'e2e-testing']",113,False,0,0
E2E Testing of event handlers in NestJS,"<p>How can you test that the proper event handler was called after specific event was emitted by an endpoint? (E2E integration test)</p>
<p>It looks like jest does not call EventEmitter2 handlers.</p>
<p>Thx.</p>
",https://stackoverflow.com/questions/71110799/e2e-testing-of-event-handlers-in-nestjs,"['jestjs', 'nestjs', 'e2e-testing', 'eventemitter']",506,False,2,0
E2E testing Docker compose + React + Spring Boot,"<p>I have a project with a Docker compose file that have a React frontend and a Spring Boot backend with a PostgreSQL database.</p>
<p>I need something that starts the app and then runs the e2e tests, but I haven't found the way yet. I haven't written the e2e tests, so they can be in any language or framework.</p>
<p>Also, I want to be able to do it in a CI environment so it have to be done automatically.</p>
",https://stackoverflow.com/questions/74915196/e2e-testing-docker-compose-react-spring-boot,"['docker', 'testing', 'docker-compose', 'e2e-testing']",55,False,0,0
"Synpress e2e testing, metamask notification dont pop out","<p>I'm writing E2E testing using synpress (a cypress wrapper) to connect with metamask chrome extension. I tested the website manually and all work fine in every condition. But, when running test with synpress something strange happen.</p>
<h4>Information to reproduce</h4>
<p>Frontend app is written in nextjs version 13, and use ethers.js to interact with an ERC721 smart contract in this way:</p>
<pre><code>contract.createToken(metadata, selectedAddresses, { from: address, gasLimit: GAS_LIMIT })
</code></pre>
<h4>Issue</h4>
<p>In test script I simply have:</p>
<pre><code>cy.confirmMetamaskTransaction().then((txData)=&gt;{
            expect(txData).not.null;
            expect(txData.confirmed).to.be.true;
        })
</code></pre>
<p>but it fails because metamask notification don't show up. The strange thing is that if I open metamask manually I can see the transaction request in the activity section, but the notification don't appear so the test is going to fail.</p>
<p>Any suggestion? Why the notification don't appear only in testing and work on manually execution?</p>
",https://stackoverflow.com/questions/74690628/synpress-e2e-testing-metamask-notification-dont-pop-out,"['cypress', 'ethereum', 'web3js', 'metamask', 'ethers.js']",262,False,1,0
Nestjs e2e testing | Cannot found module in controller,"<p>I had started studying testing in nestjs and I'm stuck. I'm using e2e tests.</p>
<p>When I try to run the test, I get an error message:</p>
<pre><code> FAIL  test/category.e2e-spec.ts
 ● Test suite failed to run

Cannot find module 'src/auth/jwt-auth-unprotected.guard' from '../src/category/category.controller.ts'

Require stack:
  C:/Users/losak/OneDrive/Desktop/back.zumzak/src/category/category.controller.ts
  C:/Users/losak/OneDrive/Desktop/back.zumzak/src/category/category.module.ts
  category.e2e-spec.ts

  13 | } from '@nestjs/common';
  14 | import { Request } from 'express';
&gt; 15 | import { JwtAuthUnprotectedGuard } from 'src/auth/jwt-auth-unprotected.guard';
     | ^
  16 | import { JwtAuthGuard } from 'src/auth/jwt-auth.guard';
  17 | import { CategoryService } from './category.service';
  18 | import { CreateCategoryDto } from './dto/create-category.dto';

  at Resolver._throwModNotFoundError (../node_modules/.pnpm/jest-resolve@28.1.3/node_modules/jest-resolve/build/resolver.js:491:11)
  at Object.&lt;anonymous&gt; (../src/category/category.controller.ts:15:1)
</code></pre>
<p>Here's my spec code (category.e2e-spec.ts):</p>
<pre><code>import { Test } from '@nestjs/testing';
import { CategoryModule } from '../src/category/category.module';
import * as request from 'supertest';

describe('CategoryController (e2e)', () =&gt; {
  let app: INestApplication;

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

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

  it('/ (GET)', () =&gt; {
    return request(app.getHttpServer())
      .get('/category')
      .expect(200)
  });
}); 
</code></pre>
<p>Here's my module (category.module.ts):</p>
<pre><code>import { Module } from '@nestjs/common';
import { CategoryController } from './category.controller';
import { ShopModule } from 'src/shop/shop.module';
import { FileService } from 'src/file/file.service';
import { PrismaService } from 'src/prisma.service';
import { CategoryService } from './category.service';

@Module({
  imports: [ShopModule],
  controllers: [CategoryController],
  providers: [CategoryService, PrismaService, FileService],
})
export class CategoryModule {}
</code></pre>
<p>And here's my controller (category.controller.ts) import:</p>
<pre><code>import { Request } from 'express';
import { JwtAuthUnprotectedGuard } from 'src/auth/jwt-auth-unprotected.guard';
import { JwtAuthGuard } from 'src/auth/jwt-auth.guard';
import { CategoryService } from './category.service';
import { CreateCategoryDto } from './dto/create-category.dto';
import { ParamsCategoryDto } from './dto/params-category.dto';
import { ParamsSearchDto } from './dto/params-search.dto';
import { UpdateCategoryDto } from './dto/update-category.dto';
</code></pre>
<p>What should I do?</p>
",https://stackoverflow.com/questions/74753367/nestjs-e2e-testing-cannot-found-module-in-controller,"['javascript', 'jestjs', 'nestjs']",147,False,1,1
Mock out external services when e2e testing with playwright,"<p>I want to write an E2E test of our signup flow using playwright. Part of our signup flow involves authentication via the Firebase SDK/API. We have a file called FirebaseClient that is responsible for this.</p>
<p>I'm not testing external services, so I want to mock out the successful response that the client will return.</p>
<p><strong>Is it possible to create a version of <code>FirebaseClient</code> that is run instead of the original only during E2E tests?</strong></p>
<p>There are several flows throughout our application that interacts with external services, so signup isn't the only place where this is important.</p>
",https://stackoverflow.com/questions/74446281/mock-out-external-services-when-e2e-testing-with-playwright,"['jestjs', 'playwright', 'playwright-test']",255,False,0,0
Integration testing vs e2e testing on a finished application,"<p>What makes more sense? I am testing a finished application for a company which is already being used by its customers. The software really only displays data. Which type of testing makes most sense, end-to-end or integration testing?
EDIT: If it makes any difference, the software up to now is completely untested.</p>
",https://stackoverflow.com/questions/74965435/integration-testing-vs-e2e-testing-on-a-finished-application,"['angular', 'testing', 'integration-testing', 'integration', 'end-to-end']",85,True,0,1
Django development server not accessible via Cypress E2E testing,"<p>I use <a href=""https://django-tenants.readthedocs.io/en/latest/"" rel=""nofollow noreferrer"">django-tenants</a> for multitenancy. I use subdomains for each tenant and have a test tenant set up with a <code>schema_name=demo</code>.</p>
<p>When running <code>python manage.py runserver</code> in local development, the server is accessible at <code>http://demo.localhost:8000</code>.</p>
<p>However, when configuring <a href=""https://cypress.io"" rel=""nofollow noreferrer"">cypress</a> to use the local server (via Chrome E2E), it does not resolve the server. I have confirmed that the server is running and accessible from a normal instance of
Chrome.</p>
<p><a href=""https://i.stack.imgur.com/Kir55.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/Kir55.png"" alt=""enter image description here"" /></a></p>
<p>My cypress config:</p>
<pre><code>module.exports = defineConfig({
    projectId: '4dofbo',
    e2e: {
        baseUrl: 'http://demo.localhost:8000',
    },
});
</code></pre>
<p>What could be causing this?</p>
",https://stackoverflow.com/questions/73562284/django-development-server-not-accessible-via-cypress-e2e-testing,"['django', 'cypress', 'django-tenants']",73,False,0,0
How to prevent redundant code in my jest e2e testing?,"<p>I am just learning to build e2e tests with Jest and Supertest.</p>
<p><strong>Test background</strong></p>
<p>Some APIs are protected by Api Keys so I need to create them on the test before running these APIs. The problem is that I have not found a way to create the API Key only once and running the same Key for all my tests. So, the result is a very verbose test that runs the same code over and over to re-create accounts and keys.</p>
<p><strong>My Code:</strong></p>
<pre><code>import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import * as chai from 'chai';
import { AppModule } from '../src/app.module';
import { ProductEvent } from 'src/events/dto/product-event.dto';
import { Account } from 'src/accounts/entities/account.entity';
import { randBrand } from '@ngneat/falso';
import { ApiKey } from 'src/accounts/entities/apikey.entity';
import { CreateApiKeyData } from 'src/accounts/dto/create-api-key-data.dto';
import { CreateAccountData } from 'src/accounts/dto/create-account-data';

describe('Accounts (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();
  });

  describe('Accounts and Keys (e2e)', () =&gt; {
    it('creates an account and key (POST)', () =&gt; {
      const accountName = randBrand();
      return request(app.getHttpServer())
        .post('/accounts')
        .send({ name: accountName })
        .expect(201)
        .then(({ body }) =&gt; {
          expect(body.name).toEqual(accountName);
          const createdId = body._id;
          return request(app.getHttpServer())
            .post('/apikeys')
            .send({ accountId: body._id })
            .expect(201)
            .then(({ body }) =&gt; {
              expect(body.accountId).toEqual(createdId);
            });
        });
    });
  });

  describe('Users (e2e)', () =&gt; {
    it('patches an user (PATCH)', () =&gt; {
      const accountName = randBrand();
      return request(app.getHttpServer())
        .post('/accounts')
        .send({ name: accountName })
        .expect(201)
        .then(({ body }) =&gt; {
          expect(body.name).toEqual(accountName);
          const createdAccountId = body._id;
          return request(app.getHttpServer())
            .post('/apikeys')
            .send({ accountId: body._id })
            .expect(200)
            .then(({ body }) =&gt; {
              expect(body.accountId).toEqual(createdAccountId);
              const createdKey = body.apiKey;
              return request(app.getHttpServer())
                .patch('/users/1')
                .send({ name: 'SomeUser', properties: { age: '20' } })
                .set('Accept', 'application/json')
                .set({ 'x-api-Key': createdKey, Accept: 'application/json' })
                .expect(201)
                .then(({ body }) =&gt; {
                  expect(body.accountId).toEqual(createdAccountId);
                  expect(body.name).toEqual('SomeUser');
                });
            });
        });
    });
  });

  describe('Events (e2e)', () =&gt; {
    it('creates an event (POST)', () =&gt; {
      const accountName = randBrand();
      return request(app.getHttpServer())
        .post('/accounts')
        .send({ name: accountName })
        .expect(201)
        .then(({ body }) =&gt; {
          expect(body.name).toEqual(accountName);
          const createdAccountId = body._id;
          return request(app.getHttpServer())
            .post('/apikeys')
            .send({ accountId: body._id })
            .expect(201)
            .then(({ body }) =&gt; {
              expect(body.accountId).toEqual(createdAccountId);
              const createdKey = body.apiKey;
              return request(app.getHttpServer())
                .post('/events')
                .send({
                  name: 'login',
                  userId: '1',
                  groupId: '2',
                  properties: { client: 'mobile' },
                })
                .set('Accept', 'application/json')
                .set({ 'x-api-Key': createdKey, Accept: 'application/json' })
                .expect(201)
                .then(({ body }) =&gt; {
                  expect(body.accountId).toEqual(createdAccountId);
                  expect(body.name).toEqual('login');
                });
            });
        });
    });
  });
});
</code></pre>
<p><strong>What I am trying to do</strong></p>
<p>There is a couple ways I could go around this redundancy, I think.</p>
<p><strong>Persist the apiKey generated in the first test</strong> and re-use it on the following tests. But, so far, I have not found a way to share a variable state between tests.</p>
<p>Or...</p>
<p><strong>Isolate the account/key creation process</strong> in a function or something that I could just re-use on the other tests without all this verbosity.</p>
<p>Can you please help me figure out how to either or both?</p>
<p>Sorry for the basic question. I am just learning things here. Searched Google extensively and couldn't find a solution.</p>
",https://stackoverflow.com/questions/72489182/how-to-prevent-redundant-code-in-my-jest-e2e-testing,"['typescript', 'jestjs', 'supertest']",161,True,1,1
ReferenceError: Request is not defined - during E2E testing NestJS project,"<p>I have a NestJsS project with a lot of controllers and I want to test it with Supertest as described here: <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>But if I create a controller that has a method where I inject request with Req() I get this error:</p>
<pre><code> FAIL  test/app.e2e-spec.ts
 Test suite failed to run

ReferenceError: Request is not defined

   5 | export class AuthController {
   6 |   @Get()
&gt;  7 |   getAll(@Req() request: Request) {
     |                          ^
   8 |     console.log('### AuthController.getAll()');
   9 |   }
  10 |

  at Object.&lt;anonymous&gt; (../src/auth/auth.controller.ts:7:26)
  at Object.&lt;anonymous&gt; (../src/auth/auth.module.ts:2:1)
</code></pre>
<p>You can simply reproduce this issue if you create a new project, then try to run E2E test with</p>
<pre><code>yarn test:e2e
</code></pre>
<p>First, it works, but if you create any controller which has a method with @Req() parameter, you get the error above.</p>
<p>Why? How can I fix it?</p>
<p>I thought Nest solved this issue, documentation wrote this:
&quot;Nest makes it easy to use the Supertest library to simulate HTTP requests.&quot;</p>
",https://stackoverflow.com/questions/74709850/referenceerror-request-is-not-defined-during-e2e-testing-nestjs-project,"['nestjs', 'e2e-testing', 'supertest']",647,True,1,1
Android E2E testing with MVVM architecture and Single Activity Pattern,"<p>I have app with mvvm architecture and single activity pattern. I am using jetpack navigation component. Now I want to make end to end test with espresso.
I want to test this scenario. User fill all data in login page and click sign in button after app navigate to new screen and fills data in new screen.Here a simple example of my code.</p>
<pre><code>@RunWith(AndroidJUnit4::class)
@MediumTest
@ExperimentalCoroutinesApi
@HiltAndroidTest
class PhoneNumberFragmentTest {
    @Rule
    @JvmField
    val hiltRule = HiltAndroidRule(this)
    private val navController = TestNavHostController(ApplicationProvider.getApplicationContext())


    @Before
    fun setUp() {
        hiltRule.inject()
    }

    @Test
    fun check_is_view_available_in_screen(){
        launchFragment&lt;PhoneNumberFragment&gt;(R.id.phoneNumberFragment,null, navController = navController)
        onView(withId(R.id.registerTitle)).check(matches(isDisplayed()))
        onView(withId(R.id.registerDescription)).check(matches(isDisplayed()))
        onView(withId(R.id.constraintPhoneNumber)).check(matches(isDisplayed()))
        onView(withId(R.id.sendOtpButton)).check(matches(isDisplayed()))
        onView(withId(R.id.agreeCheckBox)).check(matches(isDisplayed()))
        onView(withId(R.id.agreeCheckBox)).check(matches(isChecked()))
        onView(withId(R.id.sendOtpButton)).check(matches(not(isEnabled())))
        onView(withId(R.id.phoneNumber)).perform(typeText(&quot;940711242&quot;))
        onView(withId(R.id.sendOtpButton)).perform(click())

    }
}
</code></pre>
<p>Now here problem is I can't check is navigation successfully  and can't check data in new screen is displayed.</p>
",https://stackoverflow.com/questions/73782026/android-e2e-testing-with-mvvm-architecture-and-single-activity-pattern,"['android', 'mvvm', 'tdd', 'e2e-testing']",63,False,0,0
Using WebApplicationFactory to do E2E testing with .Net 6 (minimal api),"<p>Im trying to get E2E/UI testing (selenium, playwright) to work with my unit testing framework.</p>
<p>The basic idea it to use MSTest and the WebApplicationFactory to spin up a &quot;real server&quot; from within my unit tests. The reason for doing this would be to simply avoid having to deploy/release my application for testing (I guess this could be done by using containers etc, sadly.. Im not allowed to use containers). Im also thinking that doing it this wasy would be a &quot;neat&quot; way of mocking any code that calls external services, and be able to create multiple tests with different scenarios for those external calls.</p>
<p>I have searched the web for a way of doing this, but all I can find are posts about how to do this in previous .Net versions (2.1-5), but since .Net 6 the &quot;startup ceremonial&quot; code has changed and the standard way is now to use the minimal API.</p>
<p>Here is a blog post from Scott.H where he is basically doing exactly what Im planing to do, but with .Net 2.1: <a href=""https://www.hanselman.com/blog/real-browser-integration-testing-with-selenium-standalone-chrome-and-aspnet-core-21"" rel=""nofollow noreferrer"">https://www.hanselman.com/blog/real-browser-integration-testing-with-selenium-standalone-chrome-and-aspnet-core-21</a></p>
<p>What I have done so far is creating a custom class that inherits from WebApplicationFactory.</p>
<p>basically:</p>
<pre><code>class MyAppFactory : WebApplicationFactory&lt;Program&gt; {

}
</code></pre>
<p>And I can use that perfectly fine for integration testing. However.. the server thats initialized when using that class does not accept http-calls, so I cant reach that using a web browser, and neither can selenium.</p>
<p>I tried to follow Scotts blog post. But for some reason the:</p>
<pre><code>protected override TestServer CreateServer(IWebHostBuilder builder)
</code></pre>
<p>Is never called.. (not sure if that has with minimal APIs and .Net 6 to do).</p>
<p>Has anyone managed to use the WebApplicationFactory and .Net 6 Minimal API to spin up an &quot;actual server&quot; in memory that accepts http-calls?</p>
",https://stackoverflow.com/questions/71541576/using-webapplicationfactory-to-do-e2e-testing-with-net-6-minimal-api,"['testing', '.net-6.0']",1645,True,2,2
docker-compose wait for certain service to exit for e2e testing,"<p>I am trying to establish end-to-end testing with docker-compose.</p>
<p>For E2E tests I need several services:</p>
<pre><code>version: &quot;3.4&quot;
services:
  service1:
  service2:
  main_service:
    depends_on:
      - service1
</code></pre>
<p>main_service is not a daemon, it starts, do the staff, and ends.</p>
<p>So I would like all other services to live as long as main_service is alive.
I was trying this way:</p>
<pre><code>docker-compose up --exit-code-from=main_service
</code></pre>
<p>And it works, except one point :</p>
<p>service2 is also not a daemon and exists after 2 or 3 seconds.
And docker-compose with  <code>--exit-code-from=main_service</code> stops all services not when <code>main_service</code> is finished, but when <code>service2</code> is finished.</p>
<p>How can I stop all services when <code>main_service</code> is finished, but not any of them?</p>
",https://stackoverflow.com/questions/72964735/docker-compose-wait-for-certain-service-to-exit-for-e2e-testing,"['docker', 'docker-compose']",81,False,0,0
cypress GUI cannot target element in shadow dom in e2e testing,"<p>I am using the <code>cypress</code> GUI for some <code>e2e</code> testing and I want to click on an element in the UI to get the suggested selector.My problem is that my UI is in the <code>shadow DOM</code> and the selector selects the whole body of the <code>shadow host</code> element instead of targeting the element</p>
<p>In my example below I cannot target the View More button as it gets overlapped by the shadow host</p>
<p><a href=""https://i.stack.imgur.com/ctgEo.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/ctgEo.png"" alt=""enter image description here"" /></a></p>
<p>I went to my <code>cypress.config.js</code> and added this for e2e testing but it did not solve the problem</p>
<pre><code>  e2e: {
    includeShadowDom: true,
  },
</code></pre>
<p>I would appreciate your help.</p>
",https://stackoverflow.com/questions/74488791/cypress-gui-cannot-target-element-in-shadow-dom-in-e2e-testing,"['testing', 'cypress', 'shadow-dom']",11,False,0,0
TypeORM Entity Validators not working when E2E testing GraphQL API with SuperTest,"<p>Morning everybody!</p>
<p><strong>Tech Stack: NestJS + GraphQL + TypeORM</strong></p>
<p>Have a strange problem with TypeORM Entity Field validators (<code>@IsURL()</code> &amp; <code>@IsNotEmpty()</code>) not working when running E2E tests using SuperTest with a GraphQL API.</p>
<p>Important to note that the application functions as expected locally &amp; in GraphQL Playground, with the validators triggering.</p>
<p>Take URL validation for example:</p>
<p>Response from Playground with correct URL:</p>
<pre><code>{
  &quot;data&quot;: {
    &quot;createProject&quot;: {
      &quot;uuid&quot;: &quot;da1d8f48-2109-4629-a10f-67a5a7c3a5a2&quot;,
      &quot;title&quot;: &quot;f&quot;,
      &quot;description&quot;: &quot;descriptions&quot;,
      &quot;releaseDate&quot;: null,
      &quot;websiteURL&quot;: &quot;www.f.com&quot;,
      &quot;slug&quot;: &quot;f&quot;
    }
  }
}
</code></pre>
<p>Bad URL:</p>
<pre><code>{
  &quot;errors&quot;: [
    {
      &quot;message&quot;: &quot;Bad Request Exception&quot;,
      &quot;extensions&quot;: {
        &quot;code&quot;: &quot;BAD_USER_INPUT&quot;,
        &quot;response&quot;: {
          &quot;statusCode&quot;: 400,
          &quot;message&quot;: [
            &quot;websiteURL must be an URL address&quot;
          ],
          &quot;error&quot;: &quot;Bad Request&quot;
        }
      }
    }
  ],
  &quot;data&quot;: null
}
</code></pre>
<p>But when an invalid URL is used during an e2e test, no error is raised - seems that the validators are not triggering.</p>
<pre><code>{
    data: {
          createProject: {
            uuid: '2be26d1f-d6b9-4a82-addc-778e497cdb1e',
            title: 'URL Project',
            description: 'Sit aut iusto dolor sunt.',
            releaseDate: null,
            websiteURL: 'invalid url',
            slug: 'url-project'
          }
        }
      }
</code></pre>
<h2>Relevant Code</h2>
<h3>Test Setup</h3>
<pre><code>beforeEach(async () =&gt; {
    const moduleFixture: TestingModule = await Test.createTestingModule({
      imports: [
        TypeOrmModule.forRoot({
          ...testDataSourceOptions,
          entities: [],
          autoLoadEntities: true,
          dropSchema: true,
        }),
        AppModule,
      ],
    }).compile();

    const dataSource = new DataSource(testDataSourceOptions);
    await dataSource.initialize();
    await dataSource.runMigrations();

    app = moduleFixture.createNestApplication();
    await app.init();
  });
</code></pre>
<h3>Test</h3>
<pre><code>it('does not allow invalid urls', () =&gt; {
        const newURLProject = (title: string, websiteURL: string) =&gt; {
          const description = faker.lorem.sentence();
          const query = `
                    mutation CreateProject {
                        createProject(newProject: {
                            title: &quot;${title}&quot;,
                            description: &quot;${description}&quot;,
                            websiteURL: &quot;${websiteURL}&quot;
                        }) {
                            uuid
                            title
                            description
                            releaseDate
                            websiteURL
                            slug
                        }
                    }
                `;
          return { title, description, websiteURL, query };
        };

        const projectURL = newURLProject(&quot;URL Project&quot;, &quot;invalid url&quot;)
        console.log(projectURL.websiteURL)

        return request(app.getHttpServer())
          .post('/graphql')
          .send({ query: projectURL.query })
          .expect(200)
          .expect(
            ({
              body: {
                errors: { errors }
              } 
            }) =&gt; {
              console.log(errors)
              expect(errors[0].extensions.response.statusCode).toEqual(400);
              expect(errors[0].extensions.response.message).toEqual([&quot;websiteURL must be an URL address&quot;]);
            }
          )
      })
    });
</code></pre>
<p>I can include the relevant sections of the DTO and Entity code - but these work fine within the Playground and through <code>curl</code> so I do not think they are the cause of the problem.</p>
<h2>Attempted solutions</h2>
<p>I have rewritten the test code to use <code>supertest-graphql</code>, to no effect. Next step is to try replacing Supertest entirely, but that will be a significant task so I wanted to seek that Stack Overflow wisdom first.</p>
<p>Any help/advice is much appreciated.</p>
",https://stackoverflow.com/questions/72813603/typeorm-entity-validators-not-working-when-e2e-testing-graphql-api-with-supertes,"['graphql', 'nestjs', 'typeorm', 'e2e-testing', 'supertest']",376,True,1,2
"When doing e2e testing with Playwright, components aren&#39;t fully loaded before tests run","<p>I'm writing a Playwright test for a test page. The page is extremely simple, it makes a fetch to the backend to make sure it's responding (called <code>liveness</code>) which will return an OK or FAIL.</p>
<pre class=""lang-js prettyprint-override""><code>&lt;script lang=&quot;ts&quot;&gt;
    import { onMount } from &quot;svelte&quot;;
    import { fetchLiveness } from &quot;$lib/request&quot;;

    let liveness: string;

    onMount(async () =&gt; {
        liveness = await fetchLiveness();
    });
&lt;/script&gt;

&lt;div&gt;
    &lt;p&gt;Liveness Check: {liveness}&lt;/p&gt;
&lt;/div&gt;
</code></pre>
<p>The test mocks an API call, loads the page, and checks the content of the page for the expected value.</p>
<pre class=""lang-js prettyprint-override""><code>import { expect, test } from &quot;@playwright/test&quot;;

test(&quot;index page has expected liveness result&quot;, async ({ page }) =&gt; {
    await page.route('**/liveness', async (route) =&gt; {
        await route.fulfill({
            status: 200,
            contentType: &quot;application/json&quot;,
            body: &quot;OK&quot;
        });
    })
    await page.goto(&quot;/&quot;);
    expect(await page.textContent('p')).toBe('Liveness Check: OK');
});
</code></pre>
<p>Before the fetch completes, the value of liveness is <code>undefined</code>. When the test runs, this is what I'm getting as the <code>textContent</code> of the <code>p</code> element. While I can confirm that the <code>page.route</code> callback is being called, it seems it does not wait for the result. so the page is never updated from its initial state before the test finishes.</p>
<pre class=""lang-bash prettyprint-override""><code>    Error: expect(received).toBe(expected) // Object.is equality

    Expected: &quot;Liveness Check: OK&quot;
    Received: &quot;Liveness Check: undefined&quot;
</code></pre>
<p>I haven't been able to find any info on this, is there something that I need to do to tell playwright to wait for the API request to complete? Or is there something I should be doing in the svelte component so Playwright doesn't think the page load is already completed?</p>
",https://stackoverflow.com/questions/74525346/when-doing-e2e-testing-with-playwright-components-arent-fully-loaded-before-te,"['javascript', 'svelte', 'e2e-testing', 'playwright', 'svelte-3']",575,False,3,2
Does it make sense to have angular Cypress e2e testing within an own repository?,"<p>I have a few questions regarding angular (with a PHP Laravel backend) e2e testing with cypress.</p>
<ol>
<li>In my company we have the idea to have our cypress e2e tests in an extra repository so all people (backend, QA) could also write and edit tests.
I am not sure if that's such a good idea, because it feels odd to have the test not at the source code. But on the other hand, e2e also tests the backend, so it isn’t next to the source anyway. What are the best practices for Angular here? We have no staff for testing. Just front/backend developers and QA people who don’t write tests currently.</li>
<li>Is it a good Idea to have the exact same tests for e2e and integration? In my opinion, these are two different test sets and I shouldn’t just use the e2e tests with mock data to have my integration testing.</li>
</ol>
<p>Thanks in Advance!</p>
",https://stackoverflow.com/questions/73850585/does-it-make-sense-to-have-angular-cypress-e2e-testing-within-an-own-repository,"['angular', 'cypress', 'e2e-testing']",196,True,1,1
How to set up NestJS microservices integration/e2e testing KafkaJS consumer (MessagePattern/EventPattern handler),"<p>I'm proofing out an integration test with NestJS/KafkaJS.</p>
<p>I have everything implemented except the function on the event listener (consumer) for the topic I'm emitting to is not being called.</p>
<p>I read somewhere you can't consume a message until the consumer event GROUP_JOIN has completed, not sure if this is right, and/or how I could get my e2e test to wait for this to happen?</p>
<p>Here's the setup of the e2e test -</p>
<pre><code>describe('InventoryController(e2e)', () =&gt; {
  let app: INestApplication
  let client: ClientKafka
  beforeAll(async () =&gt; {
    const moduleFixture: TestingModule = await Test.createTestingModule({
      imports: [InventoryModule, KafkaClientModule],
    }).compile()
    app = moduleFixture.createNestApplication()
    await app.connectMicroservice({
      transport: Transport.KAFKA,
      options: {
        client: {
          clientId: 'test_clientid',
          brokers: process.env.KAFKA_BROKERS.split(' '), // []
          ssl: true,
          sasl: {
            mechanism: 'plain',
            username: process.env.KAFKA_CLUSTER_APIKEY,
            password: process.env.KAFKA_CLUSTER_SECRET,
          },
        },
        consumer: {
          groupId: 'test_consumerids',
        },
      },
    })
    await app.startAllMicroservices()
    await app.init()
    client = moduleFixture.get&lt;ClientKafka&gt;('test_name')
    await client.connect()
    await app.listen(process.env.port || 3000)
  })

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

  it('/ (GET)', async () =&gt; {
    return request(app.getHttpServer()).get('/inventory/kafka-inventory-test')
  })

  it('Emits a message to a topic', async () =&gt; {
    await client.emit('inventory-test', { foo: 'bar' })
  })
</code></pre>
<p>The client is emitting the message fine,</p>
<p>In my controller I have the event handler for the topic 'inventory-test'</p>
<pre><code>  @EventPattern('inventory-test')
  async consumeInventoryTest(
    // eslint-disable-next-line
    @Payload() inventoryMessage: any,
    @Ctx() context: KafkaContext,
  ): Promise&lt;void&gt; {
    console.log('inventory-test consumer')
  }
</code></pre>
<p>I have also logged the microservice with the app.getMicroservices() method and can see under the messageHandlers object it has 'inventory-test' which returns a function</p>
<pre><code>        server: ServerKafka {
          messageHandlers: Map(1) { 'inventory-test' =&gt; [Function] }
</code></pre>
<p>Also the message handler is working when I run the app locally.</p>
<p>I've been searching google a lot and the docs for both kafkajs and nest, there isn't a lot of info out there</p>
<p>Thanks for any advice/help!</p>
",https://stackoverflow.com/questions/71927921/how-to-set-up-nestjs-microservices-integration-e2e-testing-kafkajs-consumer-mes,"['nestjs', 'integration-testing', 'kafka-consumer-api', 'e2e-testing', 'kafkajs']",1420,True,0,1
Unable to connect to the database when run e2e testing in nestJS with mongodb-memory-server,"<p>I run the e2e test using mongodb memory server to mock database, create database successfully but when testBuilderModule is compile, i faced the problem about connection with database:</p>
<p><strong>[Nest] 18908  - 05/26/2022, 2:33:29 PM   ERROR [MongooseModule] Unable to connect to the database. Retrying (1)...</strong></p>
<p>Here is the code when we init the app for testing :</p>
<pre><code>const db = await MongoMemoryReplSet.create({
    replSet: { count: 1, storageEngine: 'wiredTiger' },
  });
const dbUrl = db.getUri();
  
jest.spyOn(helpers, 'createMongooseOptions').mockImplementation(() =&gt; ({
    uri: dbUrl,
    useNewUrlParser: true,
    useCreateIndex: true,
    useFindAndModify: false,
    useUnifiedTopology: true,
  }));

  let testBuilder = Test.createTestingModule({
    imports: [AppModule],
  });


  const fixture = await testBuilder.compile();

  const app = fixture.createNestApplication();

  const logger = {
    error: jest.fn(),
  };

  app.useGlobalPipes(new ValidationPipe());

  await app.init();
</code></pre>
<p>Here is dev version
&quot;mongodb-memory-server&quot;: &quot;^8.4.2&quot;,
&quot;@nestjs/testing&quot;: &quot;^8.0.0&quot;,
&quot;@types/jest&quot;: &quot;27.4.1&quot;,
&quot;supertest&quot;: &quot;^6.1.3&quot;,
&quot;jest&quot;: &quot;^27.2.5&quot;,
&quot;ts-jest&quot;: &quot;^27.0.3&quot;,</p>
<p>I can not find why it's running into this error because the db and testBuilder were created successfully. Is there a problem about version or something?</p>
",https://stackoverflow.com/questions/72388418/unable-to-connect-to-the-database-when-run-e2e-testing-in-nestjs-with-mongodb-me,"['mongodb', 'nestjs', 'e2e-testing']",653,False,0,0
How can I do e2e testing if I have passwordless sign up that sends OTP to the email?,"<p>I have a passwordless sign up flow which uses OTP code that is sent to users email.</p>
<p>Here is the function that handles the sign in/sign up:</p>
<pre><code>  // this verifies the OTP code
  const handleSignInOTP = async () =&gt; {
    toast.loading('Verifying OTP...');
    const { data, error } = await supabaseClient.auth.verifyOtp({
      email,
      token: otp,
      type: 'magiclink'
    });
    if (data) {
      toast.dismiss();
      toast.success('Successfully signed in!');
    }
    if (error) {
      toast.dismiss();
      toast.error(error.message);
    }
  };
</code></pre>
<p>At the moment I am completely lolst, how could I possibly use cypress to test something like that, is that even possible?</p>
",https://stackoverflow.com/questions/74492432/how-can-i-do-e2e-testing-if-i-have-passwordless-sign-up-that-sends-otp-to-the-em,"['javascript', 'unit-testing', 'testing', 'cypress', 'e2e-testing']",61,False,0,0
Cypress E2E testing: How to test the text message on toast container (or) popup on a web page?,"<p><a href=""https://i.stack.imgur.com/1Svg9.png"" rel=""nofollow noreferrer"">screenshot of html code for the error toast popup</a>I am trying to get the element of popup (or) toast-container and asserting the text, but I am getting an error that element never found. Please someone help?</p>
<pre><code>describe('Wholesoft Login Page', function(){

    it('Check Login popup', function(){

        cy.visit('https://https://platform.wholesoftmarket.com/login')
        cy.get('#email').type('kj@gmail.com')
        cy.get('#password').type('hello')
        cy.get('button.btn.active').click()
        cy.get('div').within(($div)=&gt;{
            cy.get('div.overlay-container').should('have.text','no record found')
        }) 
    })
 })
</code></pre>
",https://stackoverflow.com/questions/72882563/cypress-e2e-testing-how-to-test-the-text-message-on-toast-container-or-popup,"['cypress', 'toastr']",1692,True,0,2
How to intercept and give a fake response for HttpClient POST call with Angular and WebdriverIO for E2E testing,"<p>I'm testing out both Cypress and WebdriverIO to see E2E testing for an Angular app.</p>
<p>With Cypress I was able to intercept and give a fake response for the tests. But with WebdriverIO I am unable to do so, I followed the documentation on their website but the method they give you doesn't seem to work.</p>
<p>How to intercept an HTTP POST to an API and give a fake response?
My current test is this:</p>
<pre class=""lang-js prettyprint-override""><code>it('Should click on the submit button and receive a response', async () =&gt; {
    const submitButton = await $('.mat-button-wrapper');

    // zou moeten werken maar doet niks ??

    let mock = await browser.mock('UrlForBackEnd', {
        method: 'POST'
    })

    mock.respond([{
        successfull: true,
         qrcode: 'MyUrlResponse',
          errorDescription: null
    }]);

    //test werkt enkel met echte backend.
    await submitButton.click();
    await browser.debug();
});
</code></pre>
",https://stackoverflow.com/questions/72389484/how-to-intercept-and-give-a-fake-response-for-httpclient-post-call-with-angular,"['angular', 'webdriver-io']",389,False,0,0
"npm e2e testing, doesn&#39;t work in github actions in the pipeline but works fine locally : Error - Process completed with exit code 1","<p>So i've got the ci: lint test, unit test, sast and packaging to work fine. But the e2e testing doesn't work properly on GitHub actoins. I am running it solely by itself to see if it works, but it keeps coming up with this error.</p>
<ul>
<li>Process completed with exit code 1.</li>
</ul>
<p>I've run these commands in order to run on terminal. Get docker to get the container up and get the server started etc etc. So that the e2e can work.</p>
<ul>
<li>npx playwright install</li>
<li>docker-compose up -d</li>
<li>npm run start</li>
<li>npm run test-e2e</li>
</ul>
<p><a href=""https://i.stack.imgur.com/Nxep3.png"" rel=""nofollow noreferrer"">this is the e2e code that i have in my yml.</a></p>
",https://stackoverflow.com/questions/71796490/npm-e2e-testing-doesnt-work-in-github-actions-in-the-pipeline-but-works-fine-l,"['npm', 'github-actions', 'e2e-testing']",279,False,1,0
Cypress e2e testing: How to get all the elements from dynamic dropdown and should verify using test data(more than 200 items),"<p><a href=""https://i.stack.imgur.com/LhUnM.jpg"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/LhUnM.jpg"" alt=""HTML code of the dropdown items"" /></a></p>
<p>I wrote the code like this but I could get until 13 items only, after that it's not going for next elements. I could see the next elements when I scroll down in dropdown and it goes on... I am not sure how this works, but I think its due to the behavior of bindings in HTML.</p>
<p>Please can someone help to get all the elements or any other way to test this in Cypress?</p>
<pre><code>cy.visit('https://dev.wholesoftmarket.com/account/signup')
        cy.get('span.ng-tns-c381-0').contains('Account Name').click()
        cy.wait(15000)
        cy.get('p-dropdownitem &gt; li &gt; div').each(($ele, i)=&gt;{
            cy.wrap($ele).invoke('text').then((text)=&gt;{
                cy.log(text)
                expect(text).to.equal(accoun_Data.dropdowntext1[i])
                })
             })
</code></pre>
",https://stackoverflow.com/questions/72949390/cypress-e2e-testing-how-to-get-all-the-elements-from-dynamic-dropdown-and-shoul,"['javascript', 'cypress', 'dropdown']",525,True,0,2
Cypress e2e testing: How to access new tab by clicking on &quot;href&quot;. I don&#39;t have target attribute to remove and test on new opened tab?,"<p><a href=""https://i.stack.imgur.com/qVnCd.jpg"" rel=""nofollow noreferrer"">This attached image is my HTML code for href which will open a new tab</a></p>
<p>The DOM has iframe so I wrote below code accessed the href and it will open in new tab. I am unable to access the newly opened tab, though I know the method that would have target attribute so we remove that and open in same tab but here I don't have any target attributes.</p>
<p>Please check this and help to access my new tab.</p>
<pre><code>cy.visit('https://yopmail.com/en/')
cy.get('.ycptinput').type('some_name {enter}')
cy.wait(2000)
cy.get('#ifmail').its('0.contentDocument.body').then(cy.wrap).find('a').click()
</code></pre>
",https://stackoverflow.com/questions/72994758/cypress-e2e-testing-how-to-access-new-tab-by-clicking-on-href-i-dont-have-t,"['tabs', 'cypress']",420,True,2,1
No Docker client strategy found,"<p>I'm trying to implement E2E testing in <code>NestJS</code> application. I'm using Postgres in a docker container. It is running fine for other testing. The only problem is E2E testing. And I'm getting the following error:</p>
<pre><code>    No Docker client strategy found

      at node_modules/testcontainers/dist/docker/docker-client.js:46:11
      at fulfilled (node_modules/testcontainers/dist/docker/docker-client.js:5:58)


  ● Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'close')

      59 |
      60 |   afterAll(async () =&gt; {
    &gt; 61 |     await app.close();
         |               ^
      62 |     await container.stop();
      63 |   });
      64 |

      at Object.&lt;anonymous&gt; (test/event.e2e-spec.ts:61:15)
</code></pre>
<p>My code is given below:</p>
<pre><code>describe('EventAPI (e2e)', () =&gt; {
  jest.setTimeout(180_000);
  let app: INestApplication;
  let service: Service;
  let container: E2EPgContainer;

  beforeAll(async () =&gt; {
    container = new E2EPgContainer();
    await container.init();

    // eslint-disable-next-line @typescript-eslint/no-var-requires
    const AppModule = require('../src/server/app/app.module').AppModule;
    const module: TestingModule = await Test.createTestingModule({
      imports: [AppModule],
    }).compile();

    app = module.createNestApplication();
    app.useGlobalPipes(new ValidationPipe({ transform: true }));
    service = module.get&lt;Service&gt;(Service);
    await app.init();
  });
  afterEach(() =&gt; {
    jest.clearAllMocks();
  });

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

  describe('GET-POINT API', () =&gt; {
     it('GET /:customerId --&gt; should return success 200 after get points', async () =&gt; {
        // test code
     });
  });
});

</code></pre>
<p>How can I solve this issue?</p>
",https://stackoverflow.com/questions/73976244/no-docker-client-strategy-found,"['docker', 'nestjs', 'e2e-testing']",1533,True,1,1
How can one log into Auth0 for integration testing?,"<p>I'm using <a href=""https://modern-web.dev/docs/test-runner/overview/"" rel=""nofollow noreferrer"">@web/test-runner</a> to perform e2e testing of a web application that uses Auth0. This has been a problem because Auth0 doesn't allow for wildcard path addition for redirects and @web/test-runner doesn't seem to allow different-origin navigation during test running. Does anyone know of a method of signing into Auth0 during integration/e2e testing?</p>
",https://stackoverflow.com/questions/72248356/how-can-one-log-into-auth0-for-integration-testing,"['javascript', 'integration-testing', 'web-component', 'e2e-testing', 'auth0']",177,False,0,1
TypeError: elem[prop] is not a function in Webdriveio,"<blockquote>
<p>TypeError: elem[prop] is not a function</p>
</blockquote>
<p>E2E testing in webdriveio. I want to click a button inside an iframe.</p>
<pre><code>let iframe = browser.$('#fullmessage')
        browser.pause(1000)
        browser.switchToFrame(iframe)
        browser.setTimeout({ implicit: 10000 })
        let clickAgree = $('a[class=&quot;button is-success&quot;]')
        clickAgree.click()
        browser.switchToParentFrame()
        browser.pause(3000)
</code></pre>
",https://stackoverflow.com/questions/72298087/typeerror-elemprop-is-not-a-function-in-webdriveio,"['javascript', 'cucumber', 'e2e']",2209,True,2,2
How to Test an SharePoint site Page with Cypress,"<p>Does cypress support SharePoint site E2E testing? How to run E2E testing using cypress for SharePoint Sites</p>
<p>Below I have mentioned the code for generating access tokens using client id secret value. I have stored the token in local storage but after that, it was not opening any SharePoint site it's open the Microsoft sign In page.</p>
<p><strong>Commands.js</strong></p>
<pre><code>Cypress.Commands.add('generateToken', () =&gt; {
  cy.request({
    // Given: I send auth request
    url: 'https://login.microsoftonline.com/${tenantID}/oauth2/token',
    method: &quot;POST&quot;,
    header: {
      &quot;cache-control&quot;: &quot;no-cache&quot;,
      &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot;
    },
    form: true,
    body: {
      grant_type: 'password',
      tenant: '',
      client_id: '',
      client_secret: '',
      resource: '',
      username: '',
      password: ''
    }
  }).its('body')
    .then((body) =&gt; {
      // When: I get a token
      cy.log('token......', body.access_token);
      window.localStorage.setItem(&quot;access_token&quot;, body.access_token);
      window.localStorage.setItem(&quot;refresh_token&quot;, body.refresh_token);
    });
});
</code></pre>
<p>Below I have mentioned the tests case which I have created.</p>
<pre><code>import '../../support/commands';

describe('example to-do app', () =&gt; {
  it('Visits the site as logged in user', () =&gt; {
    cy.generateToken();
    cy.wait(3000);
    cy.visit('https://onlinesharepoints.sharepoint.com/sites/abcdev/Pages/test-Angular.aspx');
  })
})
</code></pre>
<p><strong>Below mention a screenshot of cypress results:</strong>
<a href=""https://i.stack.imgur.com/ub7cy.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/ub7cy.png"" alt=""Cypress Test Result"" /></a></p>
",https://stackoverflow.com/questions/71493506/how-to-test-an-sharepoint-site-page-with-cypress,"['sharepoint', 'automated-tests', 'cypress', 'ui-automation', 'sharepoint-online']",229,False,1,0
I Cant install puppeteer,"<p>I ran this script -&gt; <code>npm i --save-dev puppeteer</code> to install <code>puppeteer</code> for e2e testing purposes.</p>
<p>But there is an error while installing:</p>
<pre><code>C:\Users\Mora\Desktop\JS\Testing&gt;npm i --save-dev puppeteer

&gt; puppeteer@13.1.3 install C:\Users\Mora\Desktop\JS\Testing\node_modules\puppete
er
&gt; node install.js

ERROR: Failed to set up Chromium r950341! Set &quot;PUPPETEER_SKIP_DOWNLOAD&quot; env vari
able to skip download.
Error: Download failed: server returned code 403. URL: https://storage.googleapi
s.com/chromium-browser-snapshots/Win/950341/chrome-win.zip
    at C:\Users\Mora\Desktop\JS\Testing\node_modules\puppeteer\lib\cjs\puppeteer
\node\BrowserFetcher.js:367:27
    at ClientRequest.requestCallback (C:\Users\Mora\Desktop\JS\Testing\node_modu
les\puppeteer\lib\cjs\puppeteer\node\BrowserFetcher.js:493:13)
    at Object.onceWrapper (events.js:483:26)
    at ClientRequest.emit (events.js:376:20)
    at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
    at TLSSocket.socketOnData (_http_client.js:515:22)
    at TLSSocket.emit (events.js:376:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
npm WARN js-testing-introduction@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fse
vents):
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;win32&quot;,&quot;arch&quot;:&quot;ia32&quot;
})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\wa
tchpack-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;win32&quot;,&quot;arch&quot;:&quot;ia32
&quot;})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@13.1.3 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer@13.1.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Mora\AppData\Roaming\npm-cache\_logs\2022-02-06T10_19_25_3
69Z-debug.log
</code></pre>
<p>How can i fix this?</p>
",https://stackoverflow.com/questions/71006216/i-cant-install-puppeteer,"['javascript', 'puppeteer', 'e2e-testing']",2594,True,1,2
Why am I getting Step implementation missing for: error when there is step implementation?,"<p>I am doing e2e testing with Cypress <code>version 10.9.0</code> and using <a href=""https://www.npmjs.com/package/cypress-cucumber-preprocessor"" rel=""nofollow noreferrer"">this cypress-cucumber-preprocessor</a></p>
<pre class=""lang-js prettyprint-override""><code>Given('I am at the portal login page', () =&gt; {
    cy.visit(Cypress.env(&quot;newPortalWeb_login&quot;), { timeout: 100000 });
})

When('I enter an invalid username on the login page', () =&gt; {
    cy.get('#username').type('portal').invoke('removeAttr', 'value').click({ force: true }, { timeout: 30000 })
    cy.get('#password').type('SwY66bc3VZLUFR9')
    cy.get('[type=&quot;submit&quot;]').click()
})

Then('an error message is displayed with the text Invalid username/password', () =&gt; {
    cy.get(&quot;.invalid&quot;).should('contain.text', 'Invalid username/password')
})

When('I enter an invalid password on the login page', () =&gt; {
    cy.get('#username').type('portaluser')
    cy.get('#password').type('Srntrhn$')
    cy.get('[type=&quot;submit&quot;]').click()
})

</code></pre>
<pre><code>Feature: Login

    Scenario: #1 Test Invalid Username / Invalid Password / Empty Username / Valid Username and Empty Password
        Given I am at the portal login page
        When I enter an invalid username on the login page
        Then an error message is displayed with the text Invalid username/password
        When I enter an invalid password on the login page
        Then an error message is displayed with the text Invalid username/password
        When I enter a valid username with an empty password on the login page
        Then an error message is displayed with the text Please enter your password
        When I enter an empty username with a valid password on the login page
        Then an error message is displayed with the text Please enter your username
        When I enter an empty username with an empty password on the login page
        Then an error message is displayed with the text Please enter your username
        And an error message is displayed with the text Please enter your password
</code></pre>
<p>There is step implementation but still getting the error that says step impl is missing. Can someone assist me please? Thank you
<a href=""https://i.stack.imgur.com/5PYUJ.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/5PYUJ.png"" alt=""SS of Cypress Error"" /></a></p>
",https://stackoverflow.com/questions/74195873/why-am-i-getting-step-implementation-missing-for-error-when-there-is-step-imple,"['regex', 'cypress', 'cypress-cucumber-preprocessor']",62,True,0,2
Is there a way to make Cypress-Firefox testing as performant as Cypress-Chrome?,"<p>Apologies for the vague question, but I've noticed significant performance (runtime) differences in my E2E testing based on which browser tests are being run on.</p>
<p><code>node_modules/cypress/bin/cypress run --headless --browser firefox --spec '**/prod/1-MyTests/**'</code></p>
<p>Any advice that results in hitting my timeouts less is appreciated.</p>
",https://stackoverflow.com/questions/70978506/is-there-a-way-to-make-cypress-firefox-testing-as-performant-as-cypress-chrome,"['firefox', 'cypress', 'gitlab-ci']",103,False,1,0
How to expect different values from common properties in object jest,"<pre><code>        expect(response.body).toEqual(
          expect.objectContaining({ ...result, passsword: expect.any(String) }),
        );
</code></pre>
<p><a href=""https://i.stack.imgur.com/VGYAH.png"" rel=""nofollow noreferrer"">here is my screen with problem</a></p>
<p>Hello everybody!</p>
<p>I am trying to e2e testing and want to expect some data from recieved object. Does anybody know how to expect different values using common keys in object?</p>
",https://stackoverflow.com/questions/74814612/how-to-expect-different-values-from-common-properties-in-object-jest,"['javascript', 'node.js', 'jestjs', 'nestjs']",87,True,-2,1
e2e puppeteer wordpress traget different environment with user name and password,"<p>I am new to WordPress e2e testing.
I want to run my e2e test case with a different target site. but when i am running my script I am getting error.
for a script running.</p>
<pre><code>PUPPETEER_HEADLESS=true SKIP_SEED=true WP_BASE_URL=http://localhost:91 wp-scripts test-e2e --wordpress-username=admin --wordpress-password=password 
</code></pre>
<p>error getting</p>
<pre><code>Error: Fetch api call failed for http://localhost:91/wp-admin/admin-ajax.php?action=rest-nonce: 400
</code></pre>
",https://stackoverflow.com/questions/72621565/e2e-puppeteer-wordpress-traget-different-environment-with-user-name-and-password,"['javascript', 'php', 'wordpress', 'puppeteer', 'e2e']",78,False,0,0
Cypress 10 Is it possible to open cypress immediately without selecting testing type &amp; browser?,"<p>I want to launch cypress open without having to select my testing type and browser each time.
I will only be using e2e testing and chrome as my browser and it gets cumbersome to have to select the option each time I open cypress</p>
",https://stackoverflow.com/questions/73242717/cypress-10-is-it-possible-to-open-cypress-immediately-without-selecting-testing,['cypress'],216,True,5,1
Error on Concurse while integrating Cypress. Cypress executable not found,"<p>I'm trying to integrate cypress with concourse. I was referring to these steps. mentioned here, <a href=""https://notes.dmitriydubson.com/testing/e2e-testing/cypress-and-concourse/"" rel=""nofollow noreferrer"">https://notes.dmitriydubson.com/testing/e2e-testing/cypress-and-concourse/</a> . However, I'm getting this error. Any help is much appreciated.</p>
<pre><code>    &gt; cypressAutomation@1.0.0 testHeadless /tmp/build/ae3c03f4/cypressgit
&gt; cypress run

No version of Cypress is installed in: /root/.cache/Cypress/7.3.0/Cypress

Please reinstall Cypress by running: cypress install

----------

Cypress executable not found at: /root/.cache/Cypress/7.3.0/Cypress/Cypress

----------

Platform: linux (Debian - 8.11)
Cypress Version: 7.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypressAutomation@1.0.0 testHeadless: `cypress run`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cypressAutomation@1.0.0 testHeadless 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/2022-01-03T05_27_23_867Z-debug.log
</code></pre>
<p>This is my yaml file.</p>
<p>pipeline.yml</p>
<pre><code>resources:
- name: cypressgit
  type: git
  icon: github
  source:
    uri: https://github.com/Sparsh79/LearningCypress.git
    branch: master

jobs: 
- name: test
  serial: true
  plan:
  - get: cypressgit
    trigger: true
  - task: runtests
    privileged: true
    file: cypressgit/test.yml
</code></pre>
<p>test.yml</p>
<pre><code>    platform: linux

image_resource:
  type: docker-image
  source:
    repository: ddubson/cypress-e2e

inputs:
  - name: cypressgit
outputs:
  - name: npm-output

run:
  path: /bin/bash
  args:
    - cypressgit/ci/e2e.sh
</code></pre>
<p>e2e.sh</p>
<pre><code>    cd cypressgit/

npm run testHeadless
</code></pre>
<p>test command in package.json</p>
<pre><code>&quot;scripts&quot;: {
    &quot;testHeadless&quot;: &quot;node_modules/.bin/cypress run&quot;,
    &quot;withHeadTest&quot;: &quot;npm run testHeadless -- --headed&quot;,
    &quot;chromeTest&quot;: &quot;npm run testHeadless -- --browser chrome&quot;
}
</code></pre>
",https://stackoverflow.com/questions/70562286/error-on-concurse-while-integrating-cypress-cypress-executable-not-found,"['npm', 'cypress', 'concourse', 'concourse-fly']",460,True,2,1
Discussion and tips about API automation Efficacy,"<p>I am mainly doing UI automation using different tools but the API automation is not much familiar for me. But I wanted to know the ways of applying API automation in a efficient way.
I found some points as listed below.</p>
<ul>
<li>E2E testing uisng only API to save the time</li>
<li>Bypass functions like login to save the time</li>
<li>Do BVT (Build Verification Testing) testing using APIs</li>
</ul>
<p>Looking forward to discuss more about the topic with the industry experts. This is not about the best practices about API Automation but the <strong>API Automation Efficiency</strong></p>
<p>I found some points as listed below.</p>
<ul>
<li>E2E testing uisng only API to save the time</li>
<li>Bypass functions like login to save the time</li>
<li>Do BVT (Build Verification Testing) testing using APIs</li>
</ul>
",https://stackoverflow.com/questions/73661105/discussion-and-tips-about-api-automation-efficacy,"['api', 'automation', 'coding-efficiency']",34,False,1,1
TypeError: Class extends value undefined is not a constructor or null Custom environment NODE,"<p>I'm writing a custom environment for e2e testing with Prisma, and first I encountered an error with NODE's promisify that apparently can be resolved with opitional[?]. Now it's giving an error with NodeEnvironment. Can someone help me?</p>
<p><strong>My Custom test environment</strong></p>
<pre class=""lang-js prettyprint-override""><code>import type { Config } from '@jest/types';
import { exec } from 'node:child_process';
import * as dotenv from 'dotenv';
import NodeEnvironment from 'jest-environment-node';
import { Client } from 'pg';
import util from 'node:util';
import crypto from 'node:crypto';

dotenv.config({ path: __dirname + '/.env.test' });

const execSync = util?.promisify(exec);

const prismaBinary = './node_modules/.bin/prisma';

export default class PrismaTestEnvironment extends NodeEnvironment {
  private schema: string;
  private connectionString: string;

  constructor(config: Config.ProjectConfig) {
    super(config);

    const dbUser = process.env.DATABASE_USER;
    const dbPass = process.env.DATABASE_PASS;
    const dbHost = process.env.DATABASE_HOST;
    const dbPort = process.env.DATABASE_PORT;
    const dbName = process.env.DATABASE_NAME;

    this.schema = `test_${crypto.randomUUID()}`;
    this.connectionString = `postgresql://${dbUser}:${dbPass}@${dbHost}:${dbPort}/${dbName}?schema=${this.schema}`;
  }

  async setup() {
    process.env.DATABASE_URL = this.connectionString;
    this.global.process.env.DATABASE_URL = this.connectionString;

    await execSync(`${prismaBinary} migrate deploy`);

    return super.setup();
  }

  async teardown() {
    const client = new Client({
      connectionString: this.connectionString,
    });

    await client.connect();
    await client.query(`DROP SCHEMA IF EXISTS &quot;${this.schema}&quot; CASCADE`);
    await client.end();
  }
}

</code></pre>
<p><strong>Error</strong></p>
<p><a href=""https://i.stack.imgur.com/BBPWH.png"" rel=""nofollow noreferrer"">enter image description here</a></p>
",https://stackoverflow.com/questions/72588398/typeerror-class-extends-value-undefined-is-not-a-constructor-or-null-custom-env,"['node.js', 'jestjs', 'environment', 'prisma', 'e2e']",322,False,0,0
What are the best practices in automating end 2 end testcases?,"<p>I am trying to get a clear understanding of what e2e test cases look like.
And I am confused about how e2e testing is handled by companies. In my understanding, e2e testing is the testing of different systems and layers of the application. An example: if I am trying to e2e test a &quot;purchase&quot; endpoint I would have to also check the DB layer and do a purchase flow using UI. Please correct me if I am wrong.
SO the questing is - How would I automate this type of scenario? Do I test UI, API, and DB separately or do I write a huge test case? Also if my automation framework only handles API and DB layers. I am even able to create an e2e test case if I don't test the Web Layer?</p>
",https://stackoverflow.com/questions/71200615/what-are-the-best-practices-in-automating-end-2-end-testcases,"['java', 'testing', 'automation', 'frameworks', 'e2e']",121,False,0,0
[Flutter Integration testing][iOS] deeplink not working with background,"<p>I'm working on e2e testing with <a href=""https://docs.flutter.dev/testing/integration-tests"" rel=""nofollow noreferrer"">Integration testing</a>.
I am trying to write test of deeplink(or any Universal links or AppLinks) by using <a href=""https://pub.dev/packages/url_launcher"" rel=""nofollow noreferrer"">url_launcher</a>.
However, Android works fine but iOS doesn't.
iOS　shows up this error.</p>
<pre><code>[BackgroundTask] Background Task 50 (&quot;Flutter debug task&quot;), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
</code></pre>
<p>Does any one knows how to solve this problem?</p>
",https://stackoverflow.com/questions/73969459/flutter-integration-testingios-deeplink-not-working-with-background,"['ios', 'flutter', 'dart', 'integration-testing']",122,False,0,0
E2E test Code coverage for the application using Playwright in .NET,"<p>I have E2E testing using playwright in . NET core 6 application. Is there any way to get the report for code coverage.</p>
<p>There is a way for JS application <a href=""https://playwright.dev/docs/api/class-coverage"" rel=""nofollow noreferrer"">https://playwright.dev/docs/api/class-coverage</a></p>
<p>Using the package <a href=""https://www.npmjs.com/package/playwright-test-coverage"" rel=""nofollow noreferrer"">https://www.npmjs.com/package/playwright-test-coverage</a></p>
<p>Is there anything available for .net?</p>
",https://stackoverflow.com/questions/72527165/e2e-test-code-coverage-for-the-application-using-playwright-in-net,"['asp.net', 'asp.net-core', 'playwright', 'playwright-test', 'playwright-dotnet']",729,False,0,0
How to customize chrome browser in cypress?,"<p>I just learned web automation test using cypress. But when open cypress uses &quot;yarn&quot; and E2E testing configuration, there is no chrome browser option. My question is, how to add chrome browser in my cypress? Even though the chrome browser is already installed on my laptop. Hopefully someone can help. Thank you<a href=""https://i.stack.imgur.com/bHj0B.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/bHj0B.png"" alt=""enter image description here"" /></a></p>
",https://stackoverflow.com/questions/73537023/how-to-customize-chrome-browser-in-cypress,"['javascript', 'google-chrome', 'automated-tests', 'cypress', 'e2e-testing']",189,False,1,1
Starting Plawywright Test Browser,"<p>guys. I'm trying to set up e2e testing using Playwright. I'm following along these steps (<a href=""https://playwright.dev/docs/intro"" rel=""nofollow noreferrer"">enter link description here</a>) and I can see the tests are passing but I'd like to see the browser window so I can try and interact with the elements. How can I make the test runner open a browser window or tab?</p>
",https://stackoverflow.com/questions/74474839/starting-plawywright-test-browser,"['browser', 'e2e-testing', 'playwright']",76,True,1,2
Github action reusable workflow,"<p>I am calling a reusable workflow from another repository.</p>
<p>Basically; Build frontend -&gt; reusable workflow with e2e testing</p>
<p>However, when I'm calling the reusable workflow, it says that &quot;no tests found&quot;. The frontend repo calls the reusable workflow like this:</p>
<pre><code>e2e_tests:
  needs: publish_frontend
  name: Run e2e tests
  uses: org/repo/.github/workflows/deploy_tests.yml@master
  secrets: inherit
</code></pre>
<p>And in my e2e-test, I checkout:</p>
<pre><code>steps:
 - name: Checkout
   uses: actions/checkout@v2
   with: 
     token: ${{ secrets.GH_PAT || github.token}}
     repository: org/e2e-repo
     ref: master

</code></pre>
<p>Is there anything I'm doing wrong here?</p>
",https://stackoverflow.com/questions/73246460/github-action-reusable-workflow,['github-actions'],449,False,0,0
Cypress can not detect the alias and parse it as a node module error,"<p>When I try to e2e testing for the project I got below error.
My project is composed of Nextjs and typescript, redux.</p>
<pre><code>Error: Webpack Compilation Error
./deprecated/redux/store.js
Module not found: Error: Can't resolve '@/helpers/isServer' in 'E:\SampleWorkingProjects\redux'
resolve '@/helpers/isServer' in 'E:\SampleWorkingProjects\redux'
  Parsed request is a module
  using description file: E:\SampleWorkingProjects\package.json (relative path: ./deprecated/redux)
    resolve as module
      E:\SampleWorkingProjects\redux\node_modules doesn't exist or is not a directory
      E:\SampleWorkingProjects\node_modules doesn't exist or is not a directory
      E:\SampleWorkingProjects\node_modules doesn't exist or is not a directory
      E:\SampleWorkingProjects\node_modules doesn't exist or is not a directory
      E:\node_modules doesn't exist or is not a directory
      looking for modules in E:\SampleWorkingProjects\node_modules
        using description file: E:\SampleWorkingProjects\package.json (relative path: ./node_modules)
          using description file: E:\SampleWorkingProjects\package.json (relative path: ./node_modules/@/helpers/isServer)
            no extension
              E:\SampleWorkingProjects\node_modules\@\helpers\isServer doesn't exist
            .js
              E:\SampleWorkingProjects\node_modules\@\helpers\isServer.js doesn't exist
            .json
              E:\SampleWorkingProjects\node_modules\@\helpers\isServer.json doesn't exist
            .jsx
              E:\SampleWorkingProjects\node_modules\@\helpers\isServer.jsx doesn't exist
            .mjs
              E:\SampleWorkingProjects\node_modules\@\helpers\isServer.mjs doesn't exist
            .coffee
              E:\SampleWorkingProjects\node_modules\@\helpers\isServer.coffee doesn't exist
            .ts
              E:\SampleWorkingProjects\node_modules\@\helpers\isServer.ts doesn't exist
            .tsx
              E:\SampleWorkingProjects\node_modules\@\helpers\isServer.tsx doesn't exist
            as directory
              E:\SampleWorkingProjects\node_modules\@\helpers\isServer doesn't exist
</code></pre>
<p>I think this is because the cypress can not parse the alias @.
Below is my plugin file</p>
<pre><code>/// &lt;reference types=&quot;cypress&quot; /&gt;
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
 * @type {Cypress.PluginConfig}
 */
// eslint-disable-next-line no-unused-vars
// module.exports = (on, config) =&gt; {
//   // `on` is used to hook into various events Cypress emits
//   // `config` is the resolved Cypress config
// }
const injectDevServer = require('@cypress/react/plugins/next');

module.exports = (on, config) =&gt; {
  injectDevServer(on, config);

  return config;
};
</code></pre>
<p>I didn't add any webpack config file to the project.
But it contains cypress, typescript and next config.</p>
",https://stackoverflow.com/questions/73319085/cypress-can-not-detect-the-alias-and-parse-it-as-a-node-module-error,"['reactjs', 'webpack', 'next.js', 'cypress', 'alias']",382,False,2,0
Test users password- static or dynamic,"<p>During our e2e testing, 100+ test users are created on our application. Workflow goes like this:</p>
<pre><code>1. Generating a random password with faker library
2. Storing it in a variable
3. Using the variable to create the user 
4. Login as the created user and do some actions
5. Delete all the created users in the end(as part of teardown and via API)
</code></pre>
<p>These users will be deleted as part of cleaning up resources(teardown). From your point of view, is it better to generate passwords from faker or have a static password for all of these test users? Please share the pros and cons.</p>
",https://stackoverflow.com/questions/74697112/test-users-password-static-or-dynamic,"['selenium', 'protractor', 'ui-automation', 'e2e-testing', 'playwright']",97,True,0,1
Access to Sibling element in Playwright,"<p>I have two sibling spans in my DIV. I am doing E2E testing in Blazor and I want to access the second Span content (<code>@Status</code>).</p>
<pre><code>&lt;div&gt;
     &lt;span&gt; Status:&lt;/span&gt;
     &lt;span&gt; @Status&lt;/span&gt;
 &lt;/div&gt;
</code></pre>
<p>I found a solution for it, if it was JavaScript according to this <a href=""https://github.com/microsoft/playwright/discussions/10821"" rel=""nofollow noreferrer"">link</a>.</p>
<pre><code>const text = await page.locator(':text(&quot; Status:&quot;) + span').textContent();
</code></pre>
<p>However, I am not sure how to do the same for C# syntax. I have access to the first span but not next one.</p>
<pre><code>var firstSpan = Page.Locator(&quot;text= Status :&quot;);
</code></pre>
",https://stackoverflow.com/questions/73240528/access-to-sibling-element-in-playwright,"['c#', 'blazor', 'e2e-testing', 'playwright', 'playwright-dotnet']",4230,True,3,2
This site can’t be reached during cypress configuration,"<p>I am a newbie to cypress and trying to install cypress on my local machine but while doing configuration through UI I am getting the below issue. I already use the below command to install cypress:</p>
<pre><code>npm install cypress --save-dev
</code></pre>
<p>Step 1: Select chrome browser and click start E2E testing in Chrome
<a href=""https://i.stack.imgur.com/ZMG3M.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/ZMG3M.png"" alt=""enter image description here"" /></a></p>
<p>Sep 2: Getting the below issue after launching the chrome browser
<a href=""https://i.stack.imgur.com/83Qwo.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/83Qwo.png"" alt=""enter image description here"" /></a></p>
<p>Log:</p>
<pre><code>cypress:launcher:browsers launching browser { browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '108.0.5359.98', path: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', minSupportedVersion: 64, majorVersion: '108', isHeaded: true, isHeadless: false }, url: 'about:blank' } +0ms
  cypress:launcher:browsers spawning browser with args { args: [ 'about:blank', '--test-type', '--ignore-certificate-errors', '--start-maximized', '--silent-debugger-extension-api', '--no-default-browser-check', '--no-first-run', '--noerrdialogs', '--enable-fixed-layout', '--disable-popup-blocking', '--disable-password-generation', '--disable-single-click-autofill', '--disable-prompt-on-repos', '--disable-background-timer-throttling', '--disable-renderer-backgrounding', '--disable-renderer-throttling', '--disable-backgrounding-occluded-windows', '--disable-restore-session-state', '--disable-new-profile-management', '--disable-new-avatar-menu', '--allow-insecure-localhost', '--reduce-security-for-testing', '--enable-automation', '--disable-print-preview', '--disable-device-discovery-notifications', '--autoplay-policy=no-user-gesture-required', '--disable-site-isolation-trials', '--metrics-recording-only', '--disable-prompt-on-repost', '--disable-hang-monitor', '--disable-sync', '--disable-web-resources', '--safebrowsing-disable-download-protection', '--disable-client-side-phishing-detection', '--disable-component-update', &quot;--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'&quot;, '--disable-default-apps', '--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream', '--disable-ipc-flooding-protection', '--disable-backgrounding-occluded-window', '--disable-breakpad', '--password-store=basic', '--use-mock-keychain', '--disable-dev-shm-usage', '--proxy-server=http://localhost:58163', '--proxy-bypass-list=&lt;-loopback&gt;', '--remote-debugging-port=58175', '--remote-debugging-address=127.0.0.1', '--load-extension=C:\\Users\\dipak.bachhav\\AppData\\Roaming\\Cypress\\cy\\production\\browsers\\chrome-stable\\interactive\\CypressExtension,C:\\Users\\dipak.bachhav\\AppData\\Local\\Cypress\\Cache\\12.0.1\\Cypress\\resources\\app\\packages\\extension\\theme', '--user-data-dir=C:\\Users\\dipak.bachhav\\AppData\\Roaming\\Cypress\\cy\\production\\browsers\\chrome-stable\\interactive', '--disk-cache-dir=C:\\Users\\dipak.bachhav\\AppData\\Roaming\\Cypress\\cy\\production\\browsers\\chrome-stable\\interactive\\CypressCache' ] } +0ms
  cypress:launcher:browsers spawning browser with environment { env: { ALLUSERSPROFILE: 'C:\\ProgramData', APPDATA: 'C:\\Users\\dipak.bachhav\\AppData\\Roaming', BPPDOMAIN_MANAGER_ASM: 'EdrDotNet, Version=56.0.0.0, Culture=neutral, PublicKeyToken=da1b3922653ea916', BPPDOMAIN_MANAGER_TYPE: 'EdrDotNet.EdrAppDomainManager', COLOR: '1', CommonProgramFiles: 'C:\\Program Files\\Common Files', 'CommonProgramFiles(x86)': 'C:\\Program Files (x86)\\Common Files', CommonProgramW6432: 'C:\\Program Files\\Common Files', COMPUTERNAME: 'UKC-DSEV023991', ComSpec: 'C:\\WINDOWS\\system32\\cmd.exe', CYPRESS: 'true', CYPRESS_INTERNAL_ENV: 'production', DEBUG: 'cypress:*', DEBUG_COLORS: '1', DriverData: 'C:\\Windows\\System32\\Drivers\\DriverData', EDITOR: 'notepad.exe', FORCE_COLOR: '1', FORCE_STDERR_TTY: '1', FORCE_STDIN_TTY: '1', FORCE_STDOUT_TTY: '1', FPS_BROWSER_APP_PROFILE_STRING: 'Internet Explorer', FPS_BROWSER_USER_PROFILE_STRING: 'Default', GRADLE: 'C:\\Users\\dipak.bachhav\\Downloads\\gradle-6.9.1-bin\\gradle-6.9.1\\bin', HOME: 'C:\\Users\\dipak.bachhav', HOMEDRIVE: 'C:', HOMEPATH: '\\Users\\dipak.bachhav', INIT_CWD: 'C:\\Users\\dipak.bachhav\\CypressFramework', 'IntelliJ IDEA Community Edition': 'C:\\Users\\dipak.bachhav\\AppData\\Local\\JetBrains\\IntelliJ IDEA Community Edition 2022.1.2\\bin;', JAVA_HOME: 'C:\\Program Files\\Java\\jdk1.8.0_281', LOCALAPPDATA: 'C:\\Users\\dipak.bachhav\\AppData\\Local', LOGONSERVER: '\\\\UKC-DSEV023991', MAVEN_HOME: 'C:\\Users\\dipak.bachhav\\Downloads\\apache-maven-3.8.4\\bin', MOCHA_COLORS: '1', NODE: 'C:\\Tools\\nodejs\\node.exe', NODE_EXE: 'C:\\Tools\\nodejs\\\\node.exe', NODE_TLS_REJECT_UNAUTHORIZED: '0', NO_PROXY: '127.0.0.1,::1,localhost', NPM_CLI_JS: 'C:\\Tools\\nodejs\\\\node_modules\\npm\\bin\\npm-cli.js', npm_command: 'exec', npm_config_cache: 'C:\\Users\\dipak.bachhav\\AppData\\Local\\npm-cache', npm_config_globalconfig: 'C:\\Tools\\nodejs\\etc\\npmrc', npm_config_global_prefix: 'C:\\Tools\\nodejs', npm_config_init_module: 'C:\\Users\\dipak.bachhav\\.npm-init.js', npm_config_legacy_peer_deps: 'true', npm_config_local_prefix: 'C:\\Users\\dipak.bachhav\\CypressFramework', npm_config_metrics_registry: 'https://registry.npmjs.org/', npm_config_node_gyp: 'C:\\Tools\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js', npm_config_noproxy: '', npm_config_prefix: 'C:\\Tools\\nodejs', npm_config_userconfig: 'C:\\Users\\dipak.bachhav\\.npmrc', npm_config_user_agent: 'npm/8.19.2 node/v18.12.1 win32 x64 workspaces/false', npm_execpath: 'C:\\Tools\\nodejs\\node_modules\\npm\\bin\\npx-cli.js', npm_lifecycle_event: 'npx', npm_lifecycle_script: 'cypress', npm_node_execpath: 'C:\\Tools\\nodejs\\node.exe', npm_package_json: 'C:\\Users\\dipak.bachhav\\CypressFramework\\package.json', npm_package_name: 'cypressframework', npm_package_version: '1.0.0', NPM_PREFIX_NPX_CLI_JS: 'C:\\Tools\\nodejs\\node_modules\\npm\\bin\\npx-cli.js', NPX_CLI_JS: 'C:\\Tools\\nodejs\\node_modules\\npm\\bin\\npx-cli.js', NUMBER_OF_PROCESSORS: '4', OneDrive: 'C:\\Users\\dipak.bachhav\\OneDrive - Specsavers', OneDriveCommercial: 'C:\\Users\\dipak.bachhav\\OneDrive - Specsavers', ORIGINAL_NODE_OPTIONS: ' --openssl-legacy-provider', ORIGINAL_XDG_CURRENT_DESKTOP: 'undefined', OS: 'Windows_NT', Path: 'C:\\Users\\dipak.bachhav\\CypressFramework\\node_modules\\.bin;C:\\Users\\dipak.bachhav\\CypressFramework\\node_modules\\.bin;C:\\Users\\dipak.bachhav\\node_modules\\.bin;C:\\Users\\node_modules\\.bin;C:\\node_modules\\.bin;C:\\Tools\\nodejs\\node_modules\\npm\\node_modules\\@npmcli\\run-script\\lib\\node-gyp-bin;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\windows\\system32;C:\\windows;C:\\windows\\System32\\Wbem;C:\\windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\windows\\System32\\OpenSSH\\;C:\\Program Files\\WindowsPowerShell\\Scripts;C:\\Program Files\\Amazon\\AWSCLIV2\\;%SystemRoot%\\system32;%SystemRoot%;%SystemRoot%\\System32\\Wbem;%SYSTEMROOT%\\System32\\WindowsPowerShell\\v1.0\\;%SYSTEMROOT%\\System32\\OpenSSH\\;C:\\Users\\dipak.bachhav\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\dipak.bachhav\\AppData\\Local\\JetBrains\\IntelliJ IDEA Community Edition 2022.1.2\\bin;;C:\\Program Files\\Java\\jdk1.8.0_281;C:\\Users\\dipak.bachhav\\Downloads\\mongodb-windows-x86_64-5.0.2\\mongodb-win32-x86_64-windows-5.0.2\\bin;C:\\Users\\dipak.bachhav\\Downloads\\gradle-6.9.1-bin\\gradle-6.9.1\\bin;C:\\Users\\dipak.bachhav\\Downloads\\apache-maven-3.8.4\\bin;C:\\Users\\dipak.bachhav\\AppData\\Local\\Programs\\Git\\cmd;C:\\Users\\dipak.bachhav\\AppData\\Local\\Programs\\Python\\Python310;C:\\Users\\dipak.bachhav\\AppData\\Local\\Programs\\Python\\Python310\\Scripts;C:\\Tools\\nodejs;;C:\\Users\\dipak.bachhav\\AppData\\Local\\Programs\\Microsoft VS Code\\bin', PATHEXT: '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC', PROCESSOR_ARCHITECTURE: 'AMD64', PROCESSOR_IDENTIFIER: 'Intel64 Family 6 Model 78 Stepping 3, GenuineIntel', PROCESSOR_LEVEL: '6', PROCESSOR_REVISION: '4e03', ProgramData: 'C:\\ProgramData', ProgramFiles: 'C:\\Program Files', 'ProgramFiles(x86)': 'C:\\Program Files (x86)', ProgramW6432: 'C:\\Program Files', PROJECT_BASE_DIR: 'C:\\Users\\dipak.bachhav\\AppData\\Local\\Cypress\\Cache\\12.0.1\\Cypress\\resources\\app', PROMPT: '$P$G', PSModulePath: 'C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules', PUBLIC: 'C:\\Users\\Public', SESSIONNAME: 'Console', snow_agent: 'C:\\Program Files\\Snow Software\\Inventory\\Agent', SystemDrive: 'C:', SystemRoot: 'C:\\WINDOWS', TEMP: 'C:\\Users\\DIPAK~1.BAC\\AppData\\Local\\Temp', TMP: 'C:\\Users\\DIPAK~1.BAC\\AppData\\Local\\Temp', USERDNSDOMAIN: 'ad.Specsavers.com', USERDOMAIN: 'ROOT', USERDOMAIN_ROAMINGPROFILE: 'ROOT', USERNAME: 'dipak.bachhav', USERPROFILE: 'C:\\Users\\dipak.bachhav', UV_THREADPOOL_SIZE: '128', windir: 'C:\\WINDOWS' } } +2ms
  cypress:network:connect received error on connect, retrying { iteration: 0, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +20s
  cypress:network:connect received error on connect, retrying { iteration: 1, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +103ms
  cypress:network:connect received error on connect, retrying { iteration: 2, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +108ms
  cypress:network:connect received error on connect, retrying { iteration: 3, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +116ms
  cypress:network:connect received error on connect, retrying { iteration: 4, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +112ms
  cypress:network:connect received error on connect, retrying { iteration: 5, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +132ms
  cypress:network:connect received error on connect, retrying { iteration: 6, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +135ms
  cypress:network:connect received error on connect, retrying { iteration: 7, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +125ms
  cypress:network:connect received error on connect, retrying { iteration: 8, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +113ms
  cypress:network:connect received error on connect, retrying { iteration: 9, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +113ms
  cypress:network:connect received error on connect, retrying { iteration: 10, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +112ms
  cypress:network:connect received error on connect, retrying { iteration: 11, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58175     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58175 } } +551ms
  cypress:launcher:browsers chrome stderr: DevTools listening on ws://127.0.0.1:58175/devtools/browser/7e36c6be-5f03-448f-b778-3bb16a60f1c9 +2s
  cypress:network:connect successfully connected { opts: { host: '127.0.0.1', port: 58175, getDelayMsForRetry: [Function: getDelayMsForRetry] }, iteration: 12 } +516ms
  cypress:server:browsers:cri-client connecting { target: 'ws://127.0.0.1:58175/devtools/browser/7e36c6be-5f03-448f-b778-3bb16a60f1c9' } +0ms
  cypress:server:browsers:browser-cri-client Attaching to target url about:blank +0ms
  cypress:server:browsers:cri-client connecting { target: '8FF8DFB3A6DAD300EF9853759F387E8B' } +150ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Inspector.targetCrashed' } +13ms
  cypress:server:browsers:chrome attaching listeners to chrome { url: 'http://localhost:58163/__/', options: { browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '108.0.5359.98', path: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', minSupportedVersion: 64, majorVersion: '108', isHeaded: true, isHeadless: false }, url: 'http://localhost:58163/__/', browsers: [ [Object], [Object], [Object] ], userAgent: null, proxyUrl: 'http://localhost:58163', proxyServer: 'http://localhost:58163', socketIoRoute: '/__socket', chromeWebSecurity: true, isTextTerminal: false, downloadsFolder: 'C:\\Users\\dipak.bachhav\\CypressFramework\\cypress\\downloads', experimentalModifyObstructiveThirdPartyCode: false, experimentalWebKitSupport: false, onBrowserClose: [Function (anonymous)], onError: [Function: onError], relaunchBrowser: [AsyncFunction (anonymous)], onBrowserOpen: [Function: onBrowserOpen] } } +3s
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Network.requestWillBeSent' } +1ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Network.responseReceived' } +1ms
  cypress:launcher:browsers chrome stderr: [9984:11536:1208/135124.795:ERROR:scoped_file_writer.cc(16)] Could not open pak file for writing: The process cannot access the file because it is being used by another process. (0x20) +828ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Page.downloadWillBegin' } +441ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Page.downloadProgress' } +0ms
  cypress:server:browsers:chrome received CRI client +450ms
  cypress:server:browsers:chrome navigating to page http://localhost:58163/__/ +0ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Fetch.requestPaused' } +572ms
  cypress:server:browsers:chrome listen for frame tree changes +565ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Page.frameAttached' } +1ms
  cypress:server:browsers:cri-client registering CDP on event { eventName: 'Page.frameDetached' } +0ms
  cypress:server:browsers browser opened +4s
  cypress:launcher:browsers chrome stderr: [9984:9040:1208/135128.366:ERROR:device_event_log_impl.cc(215)] [13:51:28.372] USB: usb_device_handle_win.cc:1045 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F) +4s
  cypress:launcher:browsers chrome stderr: [9984:9040:1208/135128.377:ERROR:device_event_log_impl.cc(215)] [13:51:28.377] USB: usb_device_handle_win.cc:1045 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[9984:9040:1208/135128.377:ERROR:device_event_log_impl.cc(215)] [13:51:28.377] USB: usb_device_handle_win.cc:1045 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F) +5ms
  cypress:server:util:process_profiler current &amp; mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────┬──────────────┬─────────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │   group   │ processCount │                          pids                           │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────┼──────────────┼─────────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │ 'Chrome'  │      8       │ '9984, 8772, 6004, 13368, 9076, 15556 ... 2 more items' │    0.07    │      0.07      │  372.75  │    372.75    │   372.75    │
  cypress:server:util:process_profiler │    1    │ 'cypress' │      1       │                         '8648'                          │    3.31    │      6.86      │  330.57  │    296.42    │   330.57    │
  cypress:server:util:process_profiler │    2    │  'other'  │      6       │        '6688, 17712, 10992, 13048, 3460, 17504'         │    3.48    │      2.96      │  241.91  │    206.43    │   262.01    │
  cypress:server:util:process_profiler │    3    │ 'plugin'  │      2       │                      '9872, 10916'                      │     0      │      0.16      │  80.52   │     79.6     │    80.52    │
  cypress:server:util:process_profiler │    4    │  'TOTAL'  │      17      │                           '-'                           │    6.86    │      9.96      │ 1025.75  │    655.74    │   1025.75   │
  cypress:server:util:process_profiler └─────────┴───────────┴──────────────┴─────────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +11s
  cypress:server:util:process_profiler current &amp; mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────┬──────────────┬─────────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │   group   │ processCount │                          pids                           │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────┼──────────────┼─────────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │ 'Chrome'  │      8       │ '9984, 8772, 6004, 13368, 9076, 15556 ... 2 more items' │    4.68    │      2.37      │  384.62  │    378.68    │   384.62    │
  cypress:server:util:process_profiler │    1    │ 'cypress' │      1       │                         '8648'                          │    1.56    │      5.8       │  325.21  │    302.18    │   330.57    │
  cypress:server:util:process_profiler │    2    │  'other'  │      6       │         '6688, 17712, 10992, 1488, 16900, 2224'         │    0.82    │      2.53      │  209.05  │    206.95    │   262.01    │
  cypress:server:util:process_profiler │    3    │ 'plugin'  │      2       │                      '9872, 10916'                      │     0      │      0.12      │  80.52   │    79.83     │    80.52    │
  cypress:server:util:process_profiler │    4    │  'TOTAL'  │      17      │                           '-'                           │    7.06    │      9.38      │  999.39  │    724.47    │   1025.75   │
  cypress:server:util:process_profiler └─────────┴───────────┴──────────────┴─────────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +11s
  cypress:server:util:process_profiler current &amp; mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────┬──────────────┬─────────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │   group   │ processCount │                          pids                           │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────┼──────────────┼─────────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │ 'Chrome'  │      7       │ '9984, 8772, 6004, 13368, 9076, 15556 ... 1 more items' │   -0.28    │      1.49      │  364.69  │    374.02    │   384.62    │
  cypress:server:util:process_profiler │    1    │ 'cypress' │      1       │                         '8648'                          │   -0.16    │      4.81      │  313.13  │     304      │   330.57    │
  cypress:server:util:process_profiler │    2    │  'other'  │      6       │         '6688, 17712, 10992, 4500, 9404, 10956'         │     0      │      2.11      │  207.4   │    207.03    │   262.01    │
  cypress:server:util:process_profiler │    3    │ 'plugin'  │      2       │                      '9872, 10916'                      │   -0.07    │      0.08      │  64.07   │    76.68     │    80.52    │
  cypress:server:util:process_profiler │    4    │  'TOTAL'  │      16      │                           '-'                           │    -0.5    │      7.73      │  949.29  │    761.94    │   1025.75   │
  cypress:server:util:process_profiler └─────────┴───────────┴──────────────┴─────────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +11s
  cypress:data-context:sources:GitDataSource Refreshing git data +48s
  cypress:data-context:sources:GitDataSource getting git info for [ 'C:/Users/dipak.bachhav/CypressFramework/cypress/e2e/search.feature' ]: +203ms
  cypress:data-context:sources:GitDataSource executing command: `FOR %x in (&quot;C:\Users\dipak.bachhav\CypressFramework\cypress\e2e\search.feature&quot;) DO (git log --max-count=1 --pretty=&quot;format:%ci %ar %an|%h|%s&quot; %x)` +0ms
  cypress:data-context:sources:GitDataSource cwd: `C:\Users\dipak.bachhav\CypressFramework` +0ms
  cypress:data-context:sources:GitDataSource On current branch  +337ms
  cypress:server:util:process_profiler current &amp; mean memory and CPU usage by process group:
</code></pre>
",https://stackoverflow.com/questions/74741553/this-site-can-t-be-reached-during-cypress-configuration,['cypress'],239,False,0,0
typescript - How to enforce object destructuring in functions,"<p>I am working with playwright e2e testing, and I noticed that when trying to use <code>beforeEach</code> as a function of my own without destructing the <code>page</code> from the <code>args</code> property</p>
<pre><code>test.beforeEach((args, testInfo) =&gt; {
    console.log('heyo');
  });
</code></pre>
<p>i got the following error:</p>
<pre><code> npm run test

&gt; e2e@1.0.0 test
&gt; playwright test

Error: First argument must use the object destructuring pattern: args
  defined at playwright/appName.test.ts:7:8
</code></pre>
<p>I want to have the same functionality in my functions (to enforce using destructuring) how can I achieve this?</p>
<p>I tried digging through the playwright code to understand how they did it without success.</p>
",https://stackoverflow.com/questions/74913545/typescript-how-to-enforce-object-destructuring-in-functions,"['typescript', 'destructuring']",125,True,3,1
E2E testing with JWT guard,"<p>I’m trying to get e2e testing to work for this user update function. When user logs in their id and email are saved into JWT token and stored in HttpOnly Cookie. My problem is how to get this token so that it passes through JWT guard, gets id from JWT token and updates correct user. Because currently i'm obviously getting <code>Unauthorized</code> message.</p>
<p><strong>user.2e2-spec.ts</strong></p>
<pre><code>const mockUser: UpdateUserDto = {
  email: 'updateEmail@gmail.com',
  first_name: 'first_name1',
  last_name: 'last_name1',
  password: 'password1',
};

const mockLoginUser: LoginUserDto = {
  email: 'email@gmail.com',
  password: 'password',
};

describe('Auth controller (e2e)', () =&gt; {
  let app: INestApplication;

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

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

  it('should update user info', async () =&gt; {
    const loginRes = await request(app.getHttpServer())
      .post('/login')
      .send(mockLoginUser);

    const data = await request(app.getHttpServer())
      .put('/me/update')
      .send(mockUser)
      .expect('success');
  });

  afterAll(async () =&gt; {
    await app.close();
  });
});
</code></pre>
<p><strong>user.controller.ts</strong></p>
<pre><code>  @UseGuards(jwtAuthGuard)
  @Put('me/update')
  async updateUser(@Req() request, @Body() updateUser: UpdateUserDto) {
    const data = await this.userService.updateUser(request.user.id, updateUser);
    return data;
  }
</code></pre>
<p><strong>jwt.strategy.ts</strong></p>
<pre><code>@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
  constructor() {
    super({
      jwtFromRequest: (req) =&gt; {
        var token = null;
        if (req &amp;&amp; req.cookies) {
          token = req.cookies['jwt'];
        }
        return token;
      },
      ignoreExpiration: false,
      secretOrKey: process.env.ACCESS_SECRET,
    });
  }

  async validate(payload: any) {
    return {
      id: payload.id,
      email: payload.email,
    };
  }
}
</code></pre>
",https://stackoverflow.com/questions/72049217/e2e-testing-with-jwt-guard,"['nestjs', 'e2e-testing', 'nestjs-testing']",1806,False,1,1
How to integrate cypress to single spa?,"<p>I want to add to my single spa based project, E2E testing with Cypress. Documentation briefly explains it here briefly.<a href=""https://single-spa.js.org/docs/testing/e2e"" rel=""nofollow noreferrer"">single spa</a></p>
<p>For testing everything together I need to implement <code>import-map-overrides</code>. But I couldn't understand how to use it and also integrate cypress into my project.</p>
<p>I want to share my directories</p>
<p><code>client/ landing root navbar styleguide</code></p>
<p>Is it right to create in each of the apps it own cypress test seperately?</p>
",https://stackoverflow.com/questions/72707223/how-to-integrate-cypress-to-single-spa,"['reactjs', 'cypress', 'single-page-application', 'single-spa']",294,False,0,0
How to intercept and give a fake response for HttpClient POST call with Angular and WebdriverIO for E2E testing,"<p>I'm testing out both Cypress and WebdriverIO to see E2E testing for an Angular app.</p>
<p>With Cypress I was able to intercept and give a fake response for the tests. But with WebdriverIO I am unable to do so, I followed the documentation on their website but the method they give you doesn't seem to work.</p>
<p>How to intercept an HTTP POST to an API and give a fake response?
My current test is this:</p>
<pre class=""lang-js prettyprint-override""><code>it('Should click on the submit button and receive a response', async () =&gt; {
    const submitButton = await $('.mat-button-wrapper');

    // zou moeten werken maar doet niks ??

    let mock = await browser.mock('UrlForBackEnd', {
        method: 'POST'
    })

    mock.respond([{
        successfull: true,
         qrcode: 'MyUrlResponse',
          errorDescription: null
    }]);

    //test werkt enkel met echte backend.
    await submitButton.click();
    await browser.debug();
});
</code></pre>
",https://stackoverflow.com/questions/72389484/how-to-intercept-and-give-a-fake-response-for-httpclient-post-call-with-angular,"['angular', 'webdriver-io']",389,False,0,0
Cypress: bad redirect on click(),"<p>I'm testing an angular application with cypress (e2e testing with chrome). When I click a div element the code redirects to the /begincompilation page. Instead, when I run the test, the click redirects to the login (base url)</p>
<p>component.html</p>
<pre><code>&lt;div  [attr.data-cy]=&quot;module.name&quot; class=&quot;blog-card&quot; (click)=&quot;modClicked();&quot;&gt;
</code></pre>
<p>modClicked() is called correctly but in the cypress console they see a redirect to /home and then to /login, so the test fails because obviously the url doesn't contain /begincompilation</p>
<p><a href=""https://i.stack.imgur.com/Hegvu.png"" rel=""nofollow noreferrer"">enter image description here</a></p>
<p>spec.cy.ts</p>
<pre><code>it('Inizializzazione della compilazione', () =&gt; {

    const moduleCard = cy.get('[data-cy=&quot;cypress&quot;]').eq(1);
    moduleCard.should('be.visible');
    
    moduleCard.click();
    
    cy.url().should('include','begincompilation');
  })
</code></pre>
",https://stackoverflow.com/questions/74652941/cypress-bad-redirect-on-click,"['angular', 'testing', 'cypress', 'e2e-testing', 'angular-e2e']",47,False,0,0
Cypress Component Testing Missing package.json,"<p>I have a React App that uses webpack and Cypress E2E testing. I'm trying to use Cypress component testing. I have written a simple test as follows:</p>
<pre><code>describe('Hello World Test',  () =&gt; {
    it ('Button', () =&gt; {
        mount(&lt;Button&gt;Test button&lt;/Button&gt;)
        cy.get('button').contains('Test button').click()
    })
});
</code></pre>
<p>When I run npx cypress open-ct I get the following error:</p>
<pre><code>Your pluginsFile threw an error from: .../experimentation/webpack-transition/cypress/plugins/index.js

Error: Cannot find module 'react-scripts/package.json'
</code></pre>
<p>When I look in to my node_modules folder that file does not exist under</p>
<pre><code>@cypress/react/plugins/react-scripts/package.json (DNE)
</code></pre>
<p>cypress.json is as follows:</p>
<pre><code>{
  &quot;baseUrl&quot;: &quot;http://localhost:8080&quot;,
  &quot;component&quot;: {
    &quot;componentFolder&quot;: &quot;src&quot;,
    &quot;testFiles&quot;: &quot;**/*spec.{js,jsx,ts,tsx}&quot;
  }
}
</code></pre>
<p>package.json is as follows:</p>
<pre><code>{
  &quot;name&quot;: &quot;webpack-transition&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;main&quot;: &quot;index.js&quot;,
  &quot;scripts&quot;: {
    &quot;bundle&quot;: &quot;webpack&quot;,
    &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,
    &quot;start&quot;: &quot;webpack-dev-server --env ENV=dev --mode development --open --hot&quot;,
    &quot;build&quot;: &quot;webpack ---env ENV=dev --mode production&quot;
  },
  &quot;keywords&quot;: [],
  &quot;author&quot;: &quot;&quot;,
  &quot;license&quot;: &quot;ISC&quot;,
  &quot;devDependencies&quot;: {
    &quot;@babel/core&quot;: &quot;^7.17.5&quot;,
    &quot;@babel/plugin-proposal-class-properties&quot;: &quot;^7.16.7&quot;,
    &quot;@babel/plugin-proposal-object-rest-spread&quot;: &quot;^7.17.3&quot;,
    &quot;@babel/preset-env&quot;: &quot;^7.16.11&quot;,
    &quot;@babel/preset-react&quot;: &quot;^7.16.7&quot;,
    &quot;@babel/preset-typescript&quot;: &quot;^7.16.7&quot;,
    &quot;@types/react&quot;: &quot;^17.0.40&quot;,
    &quot;@types/react-dom&quot;: &quot;^17.0.13&quot;,
    &quot;awesome-typescript-loader&quot;: &quot;^5.2.1&quot;,
    &quot;babel-loader&quot;: &quot;^8.2.3&quot;,
    &quot;css-loader&quot;: &quot;^6.7.1&quot;,
    &quot;cypress&quot;: &quot;^9.5.1&quot;,
    &quot;dotenv-webpack&quot;: &quot;^7.1.0&quot;,
    &quot;html-webpack-plugin&quot;: &quot;^5.5.0&quot;,
    &quot;mini-css-extract-plugin&quot;: &quot;^2.6.0&quot;,
    &quot;source-map-loader&quot;: &quot;^3.0.1&quot;,
    &quot;style-loader&quot;: &quot;^3.3.1&quot;,
    &quot;typescript&quot;: &quot;^4.6.2&quot;,
    &quot;webpack&quot;: &quot;^5.70.0&quot;,
    &quot;webpack-cli&quot;: &quot;^4.9.2&quot;,
    &quot;webpack-dev-server&quot;: &quot;^4.7.4&quot;
  },
  &quot;dependencies&quot;: {
    &quot;@cypress/react&quot;: &quot;^5.12.4&quot;,
    &quot;@cypress/webpack-dev-server&quot;: &quot;^1.8.2&quot;,
    &quot;@emotion/react&quot;: &quot;^11.8.2&quot;,
    &quot;@emotion/styled&quot;: &quot;^11.8.1&quot;,
    &quot;@hookform/resolvers&quot;: &quot;^2.8.8&quot;,
    &quot;@mui/icons-material&quot;: &quot;^5.5.0&quot;,
    &quot;@mui/lab&quot;: &quot;^5.0.0-alpha.72&quot;,
    &quot;@mui/material&quot;: &quot;^5.5.0&quot;,
    &quot;@reduxjs/toolkit&quot;: &quot;^1.8.0&quot;,
    &quot;aws-amplify&quot;: &quot;^4.3.16&quot;,
    &quot;react&quot;: &quot;^17.0.2&quot;,
    &quot;react-dom&quot;: &quot;^17.0.2&quot;,
    &quot;react-hook-form&quot;: &quot;^7.28.0&quot;,
    &quot;react-icons&quot;: &quot;^4.3.1&quot;,
    &quot;react-redux&quot;: &quot;^7.2.6&quot;,
    &quot;yup&quot;: &quot;^0.32.11&quot;
  }
}
</code></pre>
<p>webpack.config is as follows:</p>
<pre><code>const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const Dotenv = require('dotenv-webpack');

module.exports =  (env) =&gt; ({
  entry: './src/components/index.tsx',
  output: {
    path: path.join(__dirname, '/dist'),
    filename: 'bundle.js',
    publicPath: '/'
  },
  resolve: {
    extensions: ['.ts', '.tsx', '.js']
  },
  module: {
    rules: [
      {
        test: /\.(ts|js)x?$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader'
        },
      },
      {
        test: /\.css$/,
        use: ['style-loader', 'css-loader']
      },
      {
        test: /\.(png|svg|jpg|jpeg|gif|ico)$/,
        exclude: /node_modules/,
        use: ['file-loader?name=[name].[ext]']
      }
    ]
  },
  devServer: {
    historyApiFallback: true,
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: './public/index.html',
      favicon: './public/favicon.ico'
    }),
    new MiniCssExtractPlugin({
      filename: './src/index.css',
    }),
    new Dotenv({
      path: `./.env.${env.ENV}`
    }),
  ]
});
</code></pre>
<p>I'm either using the wrong version of a library or I'm missing a configuration somewhere.</p>
",https://stackoverflow.com/questions/71471990/cypress-component-testing-missing-package-json,"['reactjs', 'cypress', 'cypress-component-test-runner']",1611,True,3,1
How to fix assertion error using playwright?,"<p>I'm using playwright to do e2e testing to check if the email is exists or not, and while I run my tests its said :
&quot;Finished test flow with status passed&quot;</p>
<p>But its show me that the test is failed because i have <strong>assertion error</strong> and not because i do something wrong</p>
<p>this is a piece my code:</p>
<pre><code>const fillEmail = async (page: Page, value: string) =&gt;
    await page.fill(&quot;email-for-test&quot;, value);

const fillPassword = async (page: Page, value: string) =&gt;
    await page.fill(&quot;password-for-test&quot;, value);


  await fillName(page, name);
  await fillEmail(page, email);
  const res = await page.locator('.email-error').innerText(); // return error string
  expect(res).toContain(&quot;Email is already in used&quot;);

</code></pre>
<p><a href=""https://i.stack.imgur.com/kEJMo.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/kEJMo.png"" alt=""enter image description here"" /></a>
and i got error, you can see in the picture that I uploaded
any idea how to remove or fix this error</p>
<p><a href=""https://i.stack.imgur.com/aCQwv.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/aCQwv.png"" alt=""enter image description here"" /></a></p>
",https://stackoverflow.com/questions/73293922/how-to-fix-assertion-error-using-playwright,"['testing', 'e2e-testing', 'playwright', 'playwright-test']",1876,True,0,3
Adding Regex Authorization domains in Firebase,"<p>During my e2e tests, the deployment of the site happens on a custom domain, for example if I hold the domain as:</p>
<p><code>https://example.net</code></p>
<p>then during the E2E testing the deployment happens as:</p>
<p><code>https://&lt;some-random-deployment-id&gt;.dev.example.net</code></p>
<p>Now for most of the tests, I would be mocking firebase services, however, for some specific tests, I need firebase services to be enabled. I want to know if it's possible to supply a regex since the deployment id would change after each deployment?</p>
<p>I would like to input something like: <code>^https://dev\.example\.net/.*$</code> in authorized domains.</p>
<p><a href=""https://i.stack.imgur.com/4ALom.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/4ALom.png"" alt=""enter image description here"" /></a></p>
",https://stackoverflow.com/questions/73132960/adding-regex-authorization-domains-in-firebase,"['firebase', 'firebase-authentication']",72,False,3,0
About Cypress io E2E Loging after convert to other domain question,"<p>I will be checking the website login for profile information using cypess and a E2E Testing. My Cypress Version is 9.7.0.<br>
I Setup cypress.json as<code>  &quot;chromeWebSecurity&quot;: false,</code> but when I login to some website account, I can't find  logging information afterwards, such as id, number, mail, etc.</p>
<p>This is my test case:</p>
<ol>
<li>visit ('url')</li>
<li>Write down ID number and Password</li>
<li>Click button</li>
<li>Convert to other website</li>
<li>Check profile</li>
</ol>
<p>The url domain will then change to the other url. Why does my account information clear at that point?</p>
<pre><code>it('login',function(){
cy.visit('/')
cy.wait(4000)
cy.xpath('/html/body/div[1]/div/div/div[2]/div/div[2]/div/div[1]/fieldset/div/div[1]/input').type('account')
cy.xpath('/html/body/div[1]/div/div/div[2]/div/div[2]/div/div[2]/button').click()
cy.cy.xpath('/html/body/div[1]/div/div/div[2]/div/div[2]/div/div[1]/fieldset/div/div[2]/input').type('password')

}) 

  


it('Conver to other domain url',function(){
ton').click()
//open myself information 
cy.xpath('/html/body/div[6]/div[1]/div/div[4]').click()
</code></pre>
",https://stackoverflow.com/questions/73958913/about-cypress-io-e2e-loging-after-convert-to-other-domain-question,"['cypress', 'e2e-testing', 'cypress-testing-library']",53,False,0,0
using values in describe blocks in a hierarchical manner,"<p>I'm using jest for e2e testing, and I want to be able to use the value/response in one of the describe block in the next, even to create dynamic titles, say e.g.</p>
<pre><code>describe('top most', async ()=&gt;{
   let topVar = -1;

   describe('first nested', async ()=&gt; {
       it ('get first response', async ()=&gt; {
           const res = await request('/call');
           topVar = res.body.user_id;  // returns 1001
       }

   describe(`get values for user with user_id ${topVar}`, async () =&gt; {  // topVar prints -1
      it('get the values for the user with id ${topVar}', async ()=&gt; { // topVar prints -1  
 
       
          const res = await request(`/user?user_id=${topVar}`);
          expect(res.body.user_id).toBe(1001);
     }
}
  
</code></pre>
<p>The value seems to be replaced inside the <code>it</code> block but, not in the titles. Is there any way to do that, also are the <code>it</code> and <code>describe</code> blocks always run in a sequential manner from top to bottom? I did find out about <code>--runInBand</code> but, am not sure if they meant test in different files or tests in the same file.</p>
",https://stackoverflow.com/questions/73553771/using-values-in-describe-blocks-in-a-hierarchical-manner,['jestjs'],36,True,0,1
cypress GUI cannot target element in shadow dom in e2e testing,"<p>I am using the <code>cypress</code> GUI for some <code>e2e</code> testing and I want to click on an element in the UI to get the suggested selector.My problem is that my UI is in the <code>shadow DOM</code> and the selector selects the whole body of the <code>shadow host</code> element instead of targeting the element</p>
<p>In my example below I cannot target the View More button as it gets overlapped by the shadow host</p>
<p><a href=""https://i.stack.imgur.com/ctgEo.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/ctgEo.png"" alt=""enter image description here"" /></a></p>
<p>I went to my <code>cypress.config.js</code> and added this for e2e testing but it did not solve the problem</p>
<pre><code>  e2e: {
    includeShadowDom: true,
  },
</code></pre>
<p>I would appreciate your help.</p>
",https://stackoverflow.com/questions/74488791/cypress-gui-cannot-target-element-in-shadow-dom-in-e2e-testing,"['testing', 'cypress', 'shadow-dom']",11,False,0,0
How to install and set up MySQL in an Ubuntu Docker container?,"<p>I try to create a Docker container with an installed MySQL and several other things to create environment for e2e testing.</p>
<p>My idea is:</p>
<ol>
<li>install every neccessary things into a container,</li>
<li>import a database dump,</li>
<li>run my tests,</li>
<li>generating reports</li>
<li>and so on...</li>
</ol>
<p>...inside one single container. I think this isn't the better way, but the first 2 steps is required to start building a working solution.</p>
<p>Here is my dockerfile:</p>
<pre><code>FROM ubuntu:20.04

RUN apt update

ENV DEBIAN_FRONTEND=noninteractive

RUN ln -fs /usr/share/zoneinfo/Europe/Budapest /etc/localtime

RUN apt install -y tzdata libterm-readline-gnu-perl

RUN dpkg-reconfigure -f noninteractive tzdata

RUN echo &quot;mysql-server-8.0 mysql-server/root_password password secret&quot; | debconf-set-selections \
    &amp;&amp; echo &quot;mysql-server-8.0 mysql-server/root_password_again password secret&quot; | debconf-set-selections

RUN apt install -y mysql-server

RUN mysql -uroot -psecret -e 'USE mysql; UPDATE `user` SET `Host`=&quot;%&quot; WHERE `User`=&quot;root&quot; AND `Host`=&quot;localhost&quot;; DELETE FROM `user` WHERE `Host` != &quot;%&quot; AND `User`=&quot;root&quot;; FLUSH PRIVILEGES;'

RUN /etc/init.d/mysql start
</code></pre>
<p>And the result is:</p>
<pre><code>Building containername
Step 1/10 : FROM ubuntu:20.04
 ---&gt; 26b77e58432b
Step 2/10 : RUN apt update
 ---&gt; Using cache
 ---&gt; 32aba1dda06d
Step 3/10 : ENV DEBIAN_FRONTEND=noninteractive
 ---&gt; Using cache
 ---&gt; b7de58c246b3
Step 4/10 : RUN ln -fs /usr/share/zoneinfo/Europe/Budapest /etc/localtime
 ---&gt; Using cache
 ---&gt; 00149bd68213
Step 5/10 : RUN apt install -y tzdata libterm-readline-gnu-perl
 ---&gt; Using cache
 ---&gt; 4b4162d08ed3
Step 6/10 : RUN dpkg-reconfigure -f noninteractive tzdata
 ---&gt; Using cache
 ---&gt; 36529216283e
Step 7/10 : RUN echo &quot;mysql-server-8.0 mysql-server/root_password password secret&quot; | debconf-set-selections     &amp;&amp; echo &quot;mysql-server-8.0 mysql-server/root_password_again password secret&quot; | debconf-set-selections
 ---&gt; Using cache
 ---&gt; 532e9640e40f
Step 8/10 : RUN apt install -y mysql-server
 ---&gt; Using cache
 ---&gt; 0c44dc58b319
Step 9/10 : RUN mysql -uroot -psecret -e 'USE mysql; UPDATE `user` SET `Host`=&quot;%&quot; WHERE `User`=&quot;root&quot; AND `Host`=&quot;localhost&quot;; DELETE FROM `user` WHERE `Host` != &quot;%&quot; AND `User`=&quot;root&quot;; FLUSH PRIVILEGES;'
 ---&gt; Running in 556f5cf75cc3
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
ERROR: Service 'containername' failed to build: The command '/bin/sh -c mysql -uroot -psecret -e 'USE mysql; UPDATE `user` SET `Host`=&quot;%&quot; WHERE `User`=&quot;root&quot; AND `Host`=&quot;localhost&quot;; DELETE FROM `user` WHERE `Host` != &quot;%&quot; AND `User`=&quot;root&quot;; FLUSH PRIVILEGES;'' returned a non-zero code: 1
</code></pre>
<p>How can I install &amp; setup MySQL in the docker container with a custom defined user?</p>
",https://stackoverflow.com/questions/73251295/how-to-install-and-set-up-mysql-in-an-ubuntu-docker-container,"['mysql', 'docker', 'ubuntu']",280,False,0,0
In a browser extension document.location.href behaves differently when system is under test with Cypress,"<p>I have a javascript application and somewhere in the application I have to get the current address of the page by:</p>
<pre><code>const currentUrl = window.location.href;
</code></pre>
<p><code>currentUrl</code> should have some value like <code>https//example.com/somepage/</code>.
It works fine in manual testing, however, when I put the system under test with Cypress, the return value of <code>window.location.href</code> is different from what I expected:</p>
<blockquote>
<p><a href=""https://www.example.com/__/#/specs/runner?file=cypress/e2e/integration/example.cy.js"" rel=""nofollow noreferrer"">https://www.example.com/__/#/specs/runner?file=cypress/e2e/integration/example.cy.js</a></p>
</blockquote>
<p>This's the actual url on the Cypress browser address bar.</p>
<p>What caused this behavior and how can I fix it so that during e2e testing with Cypress, the <code>window.location.href</code> will return what I'm expecting it to return?</p>
",https://stackoverflow.com/questions/73645257/in-a-browser-extension-document-location-href-behaves-differently-when-system-is,"['testing', 'url', 'cypress', 'e2e-testing', 'browser-extension']",275,True,4,1
What is a proper way to disable captcha in Auth0 when run tests with Cypress,"<p>there is an app with Auth0 authentication. I am working on Cypress test suite. Today, after many test runs locally, Auth0 started to show captcha on a login page. This is something that is hard to automate and I don't want to do this.</p>
<p>Is there any way to disable captcha in Auth0 for Cypress tests? Are there any workarounds for this? I found a few articles how to generate authentication token with api call, but I personally don't support this. This is e2e testing and we should work with an app like with a black box.</p>
<p>Please advise. Thank you.</p>
",https://stackoverflow.com/questions/71390327/what-is-a-proper-way-to-disable-captcha-in-auth0-when-run-tests-with-cypress,"['cypress', 'recaptcha', 'captcha', 'auth0']",858,False,3,1
get value input text vue using cypress,"<p>thank you for reading my question.</p>
<p>I want to ask about how to get value some input text who that value set by virtual dom/data binding in react/vue or maybe another lib/framework.</p>
<p>In my mind, a cypress is a tool for e2e testing. so that's why we can't get this value. I also check the component that I want to get by inspecting that element, and I can't get some attribute for getting  my value.</p>
<p><a href=""https://i.stack.imgur.com/3Z4ke.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/3Z4ke.png"" alt=""screen shoot of question get value input text vue using cypress"" /></a></p>
<p>idk but what should i do but i need to get this value. please tell me if you know this answer.</p>
<p>Thank you</p>
",https://stackoverflow.com/questions/71109231/get-value-input-text-vue-using-cypress,"['javascript', 'vue.js', 'cypress', 'e2e-testing']",2473,True,2,1
Open DevTools with Puppeteer on the Console tab by default,"<p>I'm using puppeteer for my E2E testing on Linux/Mac. Works like a charm, but for debugging purposes I would like to use DevTools. I start the browser as follows</p>
<pre><code> const browser = await puppeteer.launch({
     ignoreHTTPSErrors: true,
     headless: false,
     devtools: true,
     dumpio: true,
     args: [
         `--disable-extensions-except=${EXTENSION_PATH}`,
         `--load-extension=${EXTENSION_PATH}`,
         '--user-agent=PuppeteerAgent',
         '--disable-infobars',
         '--no-sandbox',
         '--disable-setuid-sandbox',
    ],
    ...(slowMo &amp;&amp; { slowMo }),
 });
</code></pre>
<p>Unfortunate, <code>dumpio</code> doesn't seem to do much, I expected to see my console.log messages in the terminal (but maybe it is not supposed to do this). But anyway, what would really help me is if I could open DevTools (which I already can) but instead of selecting the <code>Element</code> tab I would like top open by default the Console tab. Is something like this possible?</p>
<p>Something that would be nice too, is to enable <code>Preserve log</code>!</p>
",https://stackoverflow.com/questions/72692015/open-devtools-with-puppeteer-on-the-console-tab-by-default,"['google-chrome', 'google-chrome-devtools', 'puppeteer', 'e2e-testing']",903,False,1,0
Can the click method in XCUIElement be used outside of the testing framework?,"<p>I would like to click an element without user input. I see it's possible in XCUIElement which is a part of the XCTest framework to ensure things are working correctly, and I'm aware of various other testing frameworks that support E2E testing with simulated clicks. But is it possible to trigger this in production outside of testing? E.g. How app remotes work for a TV - pressing a button on the app will move right, left, or click an object on the TV (only remove the TV from this question and have it target the OS it's running on)</p>
",https://stackoverflow.com/questions/70762282/can-the-click-method-in-xcuielement-be-used-outside-of-the-testing-framework,"['ios', 'swift', 'objective-c']",59,False,0,1
Playwright: do not reuse existing web server in container environment,"<p>I am using playwright for e2e testing of my (angular) web application and loving it so far. I would like to configure playwright test to reuse an existing web server when not in CI environment nor when running from a Docker container.</p>
<p>The <a href=""https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests"" rel=""nofollow noreferrer"">playwright docs</a> provide the following example, which was helpful to start the server in CI environment only:</p>
<pre><code>  webServer: {
    command: 'npm run start',
    port: 3000,
    timeout: 120 * 1000,
    reuseExistingServer: !process.env.CI,
  },
</code></pre>
<p>I was wondering if it would be equally simple to achieve the same behavior when running from a Docker container? Or if instead I should think of another way of doing so (e.g. setting environment variables)?</p>
",https://stackoverflow.com/questions/71695118/playwright-do-not-reuse-existing-web-server-in-container-environment,"['docker', 'playwright', 'e2e']",870,False,0,0
How to setup jest and puppeteer to work with a react app?,"<p>I want to use jest and puppeteer to do e2e testing on a react app. I want the dev server to start up as part of the command to start the tests. In other words, I dont want to have to start the dev server separately and then run the e2e tests. Im just the jest-puppeteer library because I read that you can do that with this library. I have tried to get this to work but it fails with the error:</p>
<blockquote>
<p>Logging in › Splash renders
net::ERR_CONNECTION_REFUSED at http://localhost:3000</p>
</blockquote>
<p>My e2e test file</p>
<pre><code>describe(&quot;Logging in&quot;, () =&gt; {

  beforeAll(async () =&gt; {
    await page.goto(&quot;http://localhost:3000&quot;);

  });

  it(&quot;Splash renders&quot;, async () =&gt; {
    page.waitForSelector(&quot;#test-splash-signuplogin-button&quot;)
    const text = await page.$eval(&quot;#test-splash-signuplogin-button&quot;, (e) =&gt; e.textContent);
    expect(text).toBe(&quot;Signup or login&quot;)
  })
})
</code></pre>
<p>jest.config.cjs</p>
<pre><code>module.exports = {
  preset: &quot;jest-puppeteer&quot;,
  globals: {
    URL: &quot;http://localhost:3000&quot;
  },
  testRegex: &quot;./*\\e2e\\.test\\.js$&quot;,
  verbose: true
};
</code></pre>
<p>jest-puppeteer.config.cjs</p>
<pre><code>module.exports = {
  launch: {
    headless: 'false',
    devtools: false
  },
  server: {
    command: &quot;REACT_APP_ENV=local react-scripts start&quot;,
    port: 3000,
    launchTimeout: 10000,
    debug: true,
  }
}
</code></pre>
",https://stackoverflow.com/questions/71620523/how-to-setup-jest-and-puppeteer-to-work-with-a-react-app,"['reactjs', 'jest-puppeteer']",618,True,0,1
"playwright headless chromium can&#39;t find selector, but finds it in UI mode","<h2>What I'm trying to do</h2>
<p>I am doing some e2e testing with playwright on a webapp</p>
<h2>The problem</h2>
<p>I am running into problems whenever I want to save resources with headless mode.
My playwright script is working perfectly in chromium UI mode. When encountering the first from (login), this happens:</p>
<pre><code>[2022-03-31 07:57:38,079] [root] [ERROR] [MainThread]: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for selector &quot;#username&quot;
</code></pre>
<h2>What I tried</h2>
<p>I looked for answers, but can't find anything on this issue. I have absolutely no idea why an id selector would work in UI mode, but not in headless mode. It's just html and it's also able to pass other selectors like clicking buttons to get to the login. I'm at a loss here.</p>
<p>Code snippet:</p>
<pre><code># goto voice client
await page.click(selector='[title=log_in]')
await page.wait_for_timeout(timeout=500)

# enter credentials
await page.type(selector='#username', text=self.username, delay=50)
await page.type(selector='#password', text=self.password, delay=50)
await page.wait_for_timeout(timeout=100)
</code></pre>
",https://stackoverflow.com/questions/71687642/playwright-headless-chromium-cant-find-selector-but-finds-it-in-ui-mode,"['python', 'chromium', 'e2e-testing', 'playwright', 'playwright-python']",2049,True,3,3
docker-compose wont start PostgreSQL server,"<p>I'm creating a docker-compose file to prepare an e2e testing environment, but I'm experiencing some issues when starting up my PostgreSQL server for testing.</p>
<p><strong>docker-compose.my-app.e2e.yml</strong>:</p>
<pre class=""lang-yaml prettyprint-override""><code>version: &quot;3.3&quot;

services:

  my-app-e2e-db:
    image: postgres
    restart: always
    environment:
      POSTGRES_USER: my-app-e2e-user
      POSTGRES_PASSWORD: ${MY_APP_PG_PASS}
      POSTGRES_DB: my-app
      
  my-app-e2e-seeder:
    build:
      context: ..
      dockerfile: .deploy/my-app-seeder.Dockerfile
    depends_on:
      - my-app-e2e-db
</code></pre>
<p>The problem is that my seeder script fails to connect to the PostgreSQL server, and when I look into it <strong>the PostgreSQL server is not running</strong>. The odd thing is that if remove my seeder script from the docker-compose and run it, <strong>the PostgreSQL server seems to run smoothly</strong>.</p>
<pre class=""lang-yaml prettyprint-override""><code>version: &quot;3.3&quot;

services:

  my-app-e2e-db:
    image: postgres
    restart: always
    environment:
      POSTGRES_USER: my-app-e2e-user
      POSTGRES_PASSWORD: ${MY_APP_PG_PASS}
      POSTGRES_DB: my-app
      
</code></pre>
<p>I'm running the compose file with <code>docker-compose --env-file=.deploy/my-app.e2e.env -f .deploy/docker-compose.my-app.e2e.yml up -d --build</code>.</p>
<p>Thanks!</p>
<p>UPDATE!</p>
<p>It turned out I was attempting to access the database in a <code>RUN</code> step inside my Dockerfile. I moved that action to the <code>CMD</code> step instead.</p>
",https://stackoverflow.com/questions/71141174/docker-compose-wont-start-postgresql-server,"['postgresql', 'docker', 'docker-compose']",497,False,1,0
Is there a way to set up a clean testing environment for Cypress each time I run tests?,"<p>We use Cypress for thorough e2e testing on our site.
The Tech stack is React + Node(koa.js).</p>
<p>We have a high test coverage since we tend to mock most of the user actions (most of the crud methods as well).</p>
<p>It happens sometimes that a test suite fails during the execution (or is interrupted by something) so we have a duplicated entry on the next run (create test fails). Then I need to manually delete testing entries from the site and re-run the pipeline.</p>
<p>We want to make sure that we have a clean database for testing on each run. I could use an advice. Thanks in advance!</p>
",https://stackoverflow.com/questions/74716612/is-there-a-way-to-set-up-a-clean-testing-environment-for-cypress-each-time-i-run,"['node.js', 'reactjs', 'testing', 'cypress', 'e2e-testing']",30,False,0,0
"npm e2e testing, doesn&#39;t work in github actions in the pipeline but works fine locally : Error - Process completed with exit code 1","<p>So i've got the ci: lint test, unit test, sast and packaging to work fine. But the e2e testing doesn't work properly on GitHub actoins. I am running it solely by itself to see if it works, but it keeps coming up with this error.</p>
<ul>
<li>Process completed with exit code 1.</li>
</ul>
<p>I've run these commands in order to run on terminal. Get docker to get the container up and get the server started etc etc. So that the e2e can work.</p>
<ul>
<li>npx playwright install</li>
<li>docker-compose up -d</li>
<li>npm run start</li>
<li>npm run test-e2e</li>
</ul>
<p><a href=""https://i.stack.imgur.com/Nxep3.png"" rel=""nofollow noreferrer"">this is the e2e code that i have in my yml.</a></p>
",https://stackoverflow.com/questions/71796490/npm-e2e-testing-doesnt-work-in-github-actions-in-the-pipeline-but-works-fine-l,"['npm', 'github-actions', 'e2e-testing']",279,False,1,0
Should I mock APIs in end-to-end testing?,"<p>When you are doing e2e tests for your application, you want to test the whole application, not some portions of it like unit tests or integration testing.</p>
<p>But in some situations, people do mock APIs.<br>
For example, when you have a massive microservice as your back-end, which makes your e2e tests very slow, or beside your own API, you rely on other third-party APIs, which makes your e2e tests fail occasionally.<br>
So you only want to make sure that your front-end application works well, what should you do?</p>
<p>In my company, we have a massive system with a really heavy database which makes e2e testing very ineffective. Is it right to mock APIs in such a scenario?</p>
",https://stackoverflow.com/questions/71969081/should-i-mock-apis-in-end-to-end-testing,"['testing', 'automated-tests', 'end-to-end']",4261,True,7,1
Cypress multiple arrow function parameters?,"<p>So I'm just starting to learn Typescript with Cypress and I noticed this in a page I was reading about here: <a href=""https://medium.com/@NicholasBoll/cypress-io-scaling-e2e-testing-with-custom-commands-6b72b902aab"" rel=""nofollow noreferrer"">https://medium.com/@NicholasBoll/cypress-io-scaling-e2e-testing-with-custom-commands-6b72b902aab</a></p>
<pre class=""lang-js prettyprint-override""><code>export const updateTodo = (name: string) =&gt; ($todo: JQuery) =&gt; {
  cy.wrap($todo).within(() =&gt; {
    cy.get('label').dblclick()
    cy.get('.edit').clear().type(`${name}{enter}`)
  })
</code></pre>
<p>So I'm still new to typescript and I understand I think that the Jquery element is the subject parameter although I'm still a little bit unsure at what would represent a &quot;Jquery&quot; element/parameter in Cypress.</p>
<p>However what confused me is the fact that there are two fat arrow parameter sections... I've not seen that before? What exactly does that mean? Especially when further down it's called as such (With just a string):</p>
<pre class=""lang-js prettyprint-override""><code>it('should update a todo', () =&gt; {
      createTodo('Learn Cypress Command API')
        .then(updateTodo('Learn Cypress composition'))
        .then(getTodoName)
        .should('equal', 'Learn Cypress composition')
    })
</code></pre>
<p>Can anyone explain what's going on here?</p>
",https://stackoverflow.com/questions/73280327/cypress-multiple-arrow-function-parameters,['cypress'],296,True,1,1
Protractor Mac installation Issue - protractor --version zsh: command not found: protractor,"<p>I'm interested in using Protractor for e2e testing. But running into some possible installation issues on a Mac(macOS Catalina). The main problem I'm having is when trying to verify Protractor's version from the command line. I get the following message when entering protractor --version, zsh: command not found: protractor.</p>
<p>Installation steps:</p>
<p>Step 1 : Download and install node.js
<a href=""https://nodejs.org/en/download/"" rel=""nofollow noreferrer"">https://nodejs.org/en/download/</a>
verified node -v v14.17.0
verified npm -v. 6.14.13</p>
<p>Step 2 : Install Protractor</p>
<p>-verify npm install -g protractor</p>
<p>-Cannot verify protractor --version. I get this message: zsh: command not found: protractor.</p>
<p>I know how to solve this issue on a windows laptop. But have no idea how to on a mac. Thanks for any help.
<a href=""https://i.stack.imgur.com/vRAbt.png"" rel=""nofollow noreferrer"">image</a></p>
",https://stackoverflow.com/questions/71864605/protractor-mac-installation-issue-protractor-version-zsh-command-not-found,"['node.js', 'selenium', 'npm', 'protractor', 'ui-automation']",333,False,1,1
Gitlab CI with separate backend and frontend repos,"<p>I've got separate repos for backend and frontend.
Backend is used by another frontends so I cannot merge it with this particular frontend.
Backend is dependant on docker container running mysql.
Frontend depends on backend.</p>
<p>I want to do E2E testing using Cypress and I have everything set up and running locally using docker that runs backend, frontend and mysql.
However this setup does not work properly on Gitlab CI.
I've recreated the environment in <code>gitlab-ci.yml</code> but at some point it screams that there is not enough memory and it fails.</p>
<p>How else can I test my app that has frontend and backend on different repos?
Preferably without docker if at all possible since I need a local mysql DB.</p>
",https://stackoverflow.com/questions/71909155/gitlab-ci-with-separate-backend-and-frontend-repos,"['gitlab', 'cypress', 'gitlab-ci', 'e2e-testing']",597,False,0,0
Test only the currently active backend with Cypress,"<p>I'm trying to test our web application with the E2E Testing Framework Cypress. But now I've ran into a problem.</p>
<p>For our webapp we are using two backends one is active and the other inactive. But when testing it is not known which backend is currently active. How can I now write a test that doesnt fail just because one of the URL's cant be reached. Here is the code I currently have.</p>
<pre><code>describe(&quot;Backend Test&quot;, () =&gt; {
  it(&quot;Test Backend 1&quot;, () =&gt; {
    cy.visit(&quot;BACKEND1_HOSTNAME.company.com&quot;) //Lets say this fails because backend 1 is currently  inactive
  })

  it(&quot;Test Backend 2&quot;, () =&gt; {
    cy.visit(&quot;BACKEND2_HOSTNAME.company.com&quot;) //This will work because its active
  })
})
</code></pre>
<p>In this scenario the whole test-suite will fail because one of the backends doesnt respond because its not active.</p>
<p>Is there any way I can avoid the test from failing as long as <strong>one</strong> of the tests is succesful?</p>
",https://stackoverflow.com/questions/74055348/test-only-the-currently-active-backend-with-cypress,"['javascript', 'cypress', 'e2e-testing']",53,True,1,1
github actions ffmpeg gem cannot find ffprobe,"<p>so, we have been using a gem called streamio-ffmpeg, and it has been working well. We have been using github actions to to integration and E2E testing for our front end. We also had to add python for another dependency we are using. now, when we run the E2E suite on github actions, streamio-ffmpeg cannot find the ffprobe binary since python has also been installed on the actions runner.</p>
<p>we get the following message:</p>
<pre><code>Body: Puma caught this error: No such file or directory - the ffprobe binary could not be found in /home/runner/work/folder_name/another_folder_name/server/vendor/bundle/ruby/2.7.0/bin:/opt/hostedtoolcache/Python/3.10.8/x64/bin:/opt/hostedtoolcache/Python/3.10.8/x64:/opt/hostedtoolcache/Ruby/2.7.6/x64/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games (Errno::ENOENT)
</code></pre>
<p>and streamio-ffmpeg says:</p>
<pre><code>Specify the path to ffmpeg
By default, the gem assumes that the ffmpeg binary is available in the execution path and named ffmpeg and so will run commands that look something like ffmpeg -i /path/to/input.file .... Use the FFMPEG.ffmpeg_binary setter to specify the full path to the binary if necessary:

FFMPEG.ffmpeg_binary = '/usr/local/bin/ffmpeg'
</code></pre>
<p>so, how can i find out where ffprobe binary is and tell github actions this information?? I have tried manually installing ffmpeg within the github actions runner but this does not help.</p>
",https://stackoverflow.com/questions/74215521/github-actions-ffmpeg-gem-cannot-find-ffprobe,"['python', 'shell', 'ffmpeg', 'github-actions']",64,True,0,1
How to ensure a Sveltekit project can actually run on Cloudflare workers?,"<p><a href=""https://kit.svelte.dev/"" rel=""nofollow noreferrer"">Sveltekit</a> and <a href=""https://www.cloudflare.com/en-gb/"" rel=""nofollow noreferrer"">Cloudflare</a> seem to be a great match. My objective is to deliver well-tested code, that runs smoothly on Cloudflare pages/workers. To do this, I use Cypress.io for e2e testing. The problem is that I can't trust the tests running locally, as using any Node.js API works fine locally (for example <code>Buffer.from</code>). But this code <strong>breaks</strong> the site when deploying to Cloudflare.</p>
<p><strong>How can I run the Sveltekit project locally to ensure it will work once deployed?</strong></p>
<p>As a bonus, would it somehow be possible to configure the typescript project so it would throw errors when accessing Node.js API's? According to <a href=""https://developers.cloudflare.com/workers/learning/how-workers-works/"" rel=""nofollow noreferrer"">this</a> Cloudflare page, workers are running a v8 instance. We are using the &quot;official&quot; <a href=""https://www.npmjs.com/package/@sveltejs/adapter-cloudflare"" rel=""nofollow noreferrer"">adapter</a>.</p>
<p>Thanks for your help.</p>
",https://stackoverflow.com/questions/71881365/how-to-ensure-a-sveltekit-project-can-actually-run-on-cloudflare-workers,"['cloudflare', 'cloudflare-workers', 'cloudflare-pages']",1241,True,3,1
How to set an HTTP Basic Auth header in Selenide - have to use corporate proxy as well,"<p>I need to switch Basich Auth in custom client framework that use Selenide for E2E Testing from Basic URL Auth to Basic Auth with http header. The framework already uses corporate http proxy with Basic Auth, selenium Grid 4.5.0 and Selenide 6.9.0.</p>
<p>My understanding of Selenide documentation:
If <code>selenideConfig.proxyEnabled(true)</code> is set, I can use</p>
<pre><code>driver.open(selenideConfig.baseUrl(), AuthenticationType.BASIC, new BasicAuthCredentials(&quot;&quot;, username, password));
</code></pre>
<p>That should start Selenide Built-in Proxy and set basic Auth header over built-in proxy.</p>
<p>As result I got: <em>This Site cannot be reached!</em></p>
<p>If I set <code>selenideConfig.proxyEnabled(false)</code> test works but with URL basic auth.
I thought that chaining built-in and corporate proxy like this could be an fix:</p>
<pre><code>Proxy proxy = new Proxy();
proxy.setAutodetect(false);
proxy.setHttpProxy(&quot;http://corUser:corPass@corporate.proxy.com&quot;);
proxy.setSslProxy(&quot;http://corUser:corPass@corporate.proxy.com&quot;);

SelenideProxyServerFactory proxyServerFactory = new DefaultSelenideProxyServerFactory();
SelenideProxyServer selenideProxyServer = proxyServerFactory.create(selenideConfig, proxy);
WebDriverRunner.setWebDriver(driver.getWebDriver(), selenideProxyServer);
</code></pre>
<p>But I still can’t access a webpage. <em>This Site cannot be reached!</em></p>
<p>How to do this a proper way? What am I missing? Thanks.</p>
",https://stackoverflow.com/questions/74167081/how-to-set-an-http-basic-auth-header-in-selenide-have-to-use-corporate-proxy-a,"['selenium-webdriver', 'basic-authentication', 'selenide']",352,False,1,1
"Synpress e2e testing, metamask notification dont pop out","<p>I'm writing E2E testing using synpress (a cypress wrapper) to connect with metamask chrome extension. I tested the website manually and all work fine in every condition. But, when running test with synpress something strange happen.</p>
<h4>Information to reproduce</h4>
<p>Frontend app is written in nextjs version 13, and use ethers.js to interact with an ERC721 smart contract in this way:</p>
<pre><code>contract.createToken(metadata, selectedAddresses, { from: address, gasLimit: GAS_LIMIT })
</code></pre>
<h4>Issue</h4>
<p>In test script I simply have:</p>
<pre><code>cy.confirmMetamaskTransaction().then((txData)=&gt;{
            expect(txData).not.null;
            expect(txData.confirmed).to.be.true;
        })
</code></pre>
<p>but it fails because metamask notification don't show up. The strange thing is that if I open metamask manually I can see the transaction request in the activity section, but the notification don't appear so the test is going to fail.</p>
<p>Any suggestion? Why the notification don't appear only in testing and work on manually execution?</p>
",https://stackoverflow.com/questions/74690628/synpress-e2e-testing-metamask-notification-dont-pop-out,"['cypress', 'ethereum', 'web3js', 'metamask', 'ethers.js']",262,False,1,0
How to call a function in a differnt Cypress file?,"<p>I am playing around with Cypress for e2e testing and  want to execute login flow on each of the spec file.
I know that we can do it by storing it locally by writing custom commands like this :</p>
<pre><code>Cypress.Commands.add('login', ()=&gt; {
cy.request({
    method : 'POST',
    url : 'url',
    ...
    }
    }).then((resp) =&gt; {
    
        window.localStorage.setItem('jwt',resp.body.user.token)
      
    })
  })
</code></pre>
<p>and then calling this function in our actual spec file.</p>
<p>But with my application, there are multiple api calls to be made one after the other in order to actually land up inside the application. How can I achieve this in custom commands? My application actually takes username and password in step-1, and then from the jwt received it executes another api call, and then a final one. I want to store the last jwt value so that I can continue with the rest of the application.</p>
",https://stackoverflow.com/questions/73021094/how-to-call-a-function-in-a-differnt-cypress-file,['cypress'],83,False,1,2
NestJS returns buffer instead of JSON in e2e,"<p>While e2e testing with jest/supertest the body returned from my app seems to be a buffer rather than just JSON.</p>
<p>The test module:</p>
<pre><code>const testingModule = await Test.createTestingModule({
  imports: [AppModule],
}).compile();

const app = testingModule.createNestApplication();

app.useGlobalPipes(
  new ValidationPipe({
    whitelist: true,
    forbidNonWhitelisted: true,
  }),
);

await app.init();
server = app.getHttpServer();
</code></pre>
<p>In the test I expect the <code>ValidationPipe</code> to throw an error about the password being too short:</p>
<pre><code>const res = request(server)
  .post(path)
  .accept('application/json')
  .responseType('application/json')
  .set('Authorization', `Bearer ${token}`)
  .send({
    email: 'abc@abc.abc',
    displayName: 'Abc',
    password: 'abc'
  });

res.expect({error: 'Bad Request'}); // fails with expected { error: 'Bad Request' } response body, got &lt;Buffer 7b 22 73 74...
</code></pre>
<p>The endpoint is:</p>
<pre><code>@Post()
@UseGuards(AnonymousGuard)
@ApiBearerAuth('Firebase JWT')
@ApiCreatedResponse({ description: 'Success' })
@ApiUnauthorizedResponse({ description: 'Authorization failed' })
@ApiConflictResponse({ description: 'User exists' })
@ApiBadRequestResponse({ description: 'Malformed request' })
createUser(@Body() body: CreateUserBody) {
  throw new HttpException('not implemented', HttpStatus.NOT_IMPLEMENTED);
}
</code></pre>
<p>And the validation in:</p>
<pre><code>export class CreateUserBody {
  @IsEmail()
  @ApiProperty()
  email: string;

  @IsString()
  @MinLength(2)
  @MaxLength(30)
  @ApiProperty()
  displayName: string;

  @IsString()
  @MinLength(8)
  @ApiProperty()
  password: string;
}
</code></pre>
<p>The problem is that the test response doesn't contain JSON but rather a buffer:</p>
<pre><code>console.log(res.body);             // &lt;Buffer 7b 22 73 74 61 74 75...
console.log(JSON.parse(res.body)); // { error: &quot;Bad request&quot;,
    message: [ 'password must be longer...
</code></pre>
<p>I do not use any interceptors but some middleware I've got is async – could this be a problem?</p>
<p>I can get away with parsing the body, but every example on the internet seems to just use <code>req.body</code> (e.g. <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>) while I can't seem to be able to and I'm not sure what could cause that.</p>
",https://stackoverflow.com/questions/73443902/nestjs-returns-buffer-instead-of-json-in-e2e,"['json', 'jestjs', 'nestjs', 'supertest']",54,True,0,1
Why are TS errors thrown locally after checkout out a PR and not on CI?,"<p>I am doing some e2e testing in Cypress using TS and trying to understand why I am having TS errors locally and no errors are thrown on CI.</p>
<p>This is strange because I did not have the TS errors with Cypress before checking out the PR, but now I do. No tsconfig settings were changed so I am confused about why this is happening.</p>
<p>After checkout our this PR, I get linting over the <code>resolveJsonModule</code> option, but here is the current tsconfig I have in Cypress:</p>
<pre><code>{
    &quot;compilerOptions&quot;: {
        &quot;strict&quot;: true,
        &quot;target&quot;: &quot;es6&quot;,
        &quot;lib&quot;: [&quot;esnext&quot;, &quot;dom&quot;],
        &quot;baseUrl&quot;: &quot;./&quot;,
        &quot;resolveJsonModule&quot;: true,
        &quot;esModuleInterop&quot;: true,
        &quot;noImplicitAny&quot;: false,
        &quot;types&quot;: [&quot;cypress&quot;, &quot;@testing-library/cypress&quot;]
    },
    &quot;include&quot;: [&quot;**/*.ts&quot;]
}

</code></pre>
<p>All the TS errors that were received after cloning PR none of which were present before cloning this PR:
<a href=""https://i.stack.imgur.com/MJf93.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/MJf93.png"" alt=""TS errors"" /></a></p>
<p><strong>UPDATE</strong>: Narrowed this down to a VSCODE specific issue because the app builds perfectly from the command line.</p>
",https://stackoverflow.com/questions/73490069/why-are-ts-errors-thrown-locally-after-checkout-out-a-pr-and-not-on-ci,"['typescript', 'cypress', 'e2e-testing', 'cypress-testing-library']",39,False,0,2
Why does upgrading chome and chrome driver stop web application from loading,"<p>Im Running E2E testing on a web application in Jenkins using a centos node with webdriver IO.</p>
<p>Chrome :google-chrome-stable-96.0.4664.110-1.x86_64.rpm
Chrome driver:</p>
<pre><code>sh 'sudo yum info google-chrome-stable | grep Version &gt; chromeOutFile'
                    def CHROME_VERSION = readFile('chromeOutFile')
                    def Version = CHROME_VERSION.split('Version     :')
                    def VersionNumber = Version[1].trim()
                    sh &quot;./src/main/web/node_modules/protractor/bin/webdriver-manager update --versions.chrome=${VersionNumber}&quot;
</code></pre>
<p>Id like to update this to user the latest version of chrome with a corresponding chrome driver.</p>
<p>Webdriver IO config:</p>
<pre><code>services: [['chromedriver', {
        chromedriverCustomPath: '../node_modules/webdriver-manager/selenium/chromedriver_96.0.4664.110'
    }]],
</code></pre>
<p>Problem: when I try to use a more upto date version, even if its chromedriver_97.0.4692.99, my web application no longer starts up in Jenkins. When I try to visit the url, the screen shot just shows a blank screen. Im not sure the application is even loading.</p>
<p>Why does it only work with 96 but not others?</p>
<p>I tried to map the version of chrome with an appropriate version of chrome driver using <a href=""https://chromedriver.storage.googleapis.com/LATEST_RELEASE_97.0.4692"" rel=""nofollow noreferrer"">https://chromedriver.storage.googleapis.com/LATEST_RELEASE_97.0.4692</a> but that still doesnt work for me.</p>
<p>Running tests:</p>
<pre><code>cd e2e &amp;&amp; wdio run wdio.ci.conf.ts --suite access --logLevel=info

+ lsb_release -d
Description:    CentOS Linux release 7.9.2009 (Core)
</code></pre>
<p>Thanks</p>
",https://stackoverflow.com/questions/74699902/why-does-upgrading-chome-and-chrome-driver-stop-web-application-from-loading,"['jenkins', 'selenium-chromedriver', 'centos7', 'webdriver-io']",132,False,3,1
JavaScript regex check line break,"<p>I get information from a database that includes Locker code and is dependent on the orderId. Some orders have a Locker code, which is used to unlock the door when customers pick up their orders from locker storage.</p>
<p>If the locker exist then it will show in UI like this:</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>Locker code: // this is one html div


123456 // and the code is in another div which is string</code></pre>
</div>
</div>
</p>
<p>I used regex to test the locker code in E2E testing. That regex will match the string &quot;Locker code&quot; and six digits . For that regex match I did like this <code>expect(body).toMatch(/Locker code: [\r\n]+ \[A-Z0-9]+/)</code>. But seems like regex match does not work. I believe it is due to the &quot;Locker code&quot; and the use of a 6-digit number string in two different divs. But I can't say I'm certain. Is there any better way I can test &quot;Locker code&quot; and six digits?</p>
",https://stackoverflow.com/questions/72644553/javascript-regex-check-line-break,"['javascript', 'regex']",38,True,1,1
Detox e2e build doesnt display any styling or images,"<p>I have had my fair share of detox today - I'm sitting with an issue where I create a build for detox to create e2e testing with <code>detox build--configuration android</code> and then running <code>detox test --configuration android</code> to run my tests, the CSS and Images do not display and Detox then says that there are no visible elements that it can target and bombs out because the test cant proceed without the elements being visible.</p>
<p>BUT if I create a normal release build or a Dev build then everything is there Images and styling.</p>
<p>Is there anyone here that can advise on how to fix this ? I had a look on the internet for a solution but couldn't find any and I did create a Ticket on Detox's GitHub <a href=""https://github.com/wix/Detox/issues/3635But"" rel=""nofollow noreferrer"">https://github.com/wix/Detox/issues/3635But</a> I am not sure when they will reply on that ticket</p>
",https://stackoverflow.com/questions/74107077/detox-e2e-build-doesnt-display-any-styling-or-images,"['reactjs', 'react-native', 'detox']",55,False,1,0
Cypress in docker can&#39;t find cypress.json file,"<p>I'm struggling with testing my app with my Cypress with docker, I use the dedicated docker image with this command  : <code>docker run -it -v $PWD:/e2e -w /e2e cypress/included:8.7.0  </code></p>
<p>I have ALWAYS this error when I launch it : `Could not find a Cypress configuration file, exiting.</p>
<p>We looked but did not find a default config file in this folder: /e2e`</p>
<p>Meaning that cypress can't find the cypress.json but it is precisely in the dedicated folder, here is my directory/file tree :</p>
<pre><code>pace    
   front
      cypress
      cypress.json
</code></pre>
<p>So this is a standard file tree for e2e testing, and  despite all of my tricks (not using $PWD but using full directory path, reinstall docker, colima engine etc. nothings works, and if I run npm run cypress locally everything works just fine !</p>
<p>Needless to say that I am in the /pace/front directory when I'm trying these commands</p>
<p>Can you help me please ?</p>
",https://stackoverflow.com/questions/70686102/cypress-in-docker-cant-find-cypress-json-file,"['docker', 'cucumber', 'cypress', 'e2e']",2971,False,0,1
Gitlab-ci service command not running,"<p>I'm trying to spin up my backend image to use for e2e-testing. When building the backend I make an image which can be used for a service in the frontend. My <code>.gitlab-cy.yml</code> looks partly likes this:</p>
<pre><code>build-test:
  stage: build
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
    - docker build --build-arg BUILD_ARGUMENT_ENV=test --build-arg BUILD_ARGUMENT_DEBUG_ENABLED=true -t registry.gitlab.com/&lt;company&gt;/&lt;repo&gt;/test:latest .
    - docker push registry.gitlab.com/&lt;company&gt;/&lt;repo&gt;/test:latest
  only:
    changes:
      - Dockerfile
      - docker-compose.yml
      - .gitlab-ci.yml
      - docker/*
      - .env.citest
  when: manual
  tags:
    - test
</code></pre>
<p>The job in the front-end looks like this:</p>
<pre><code>e2e-testing:
  image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
  services:
    - name: registry.gitlab.com/&lt;company&gt;/&lt;repo&gt;/test:latest
      alias: &lt;company&gt;-backend
      command: [
        &quot;php artisan db:seed&quot;
      ]
    - name: postgis/postgis:12-3.3
      alias: postgres_citest
    - name: redis:5.0.9
      alias: redis_citest
  variables:
    POSTGRES_DB: &lt;company&gt;_citest
    POSTGRES_USER: &lt;company&gt;
    POSTGRES_PASSWORD: secret
    REDIS_PORT: 6379
  stage: testing
  before_script:
    - yarn
    - yarn run dev &amp;
  script:
    - yarn run e2e:record --parallel --env IS_CI_RUNNING=true
  artifacts:
    when: always
    paths:
      - cypress/videos/**/*.mp4
      - cypress/screenshots/**/*.png
    expire_in: 1 day
  tags:
    - test
</code></pre>
<p>The command <code>php artisan db:seed</code> isn't preformed and I get the following error:
<code>exec: php artisan db:seed: not found</code></p>
<p>The other services are used by the backend so I figured they need to be spin up as well. How do I get the command working?</p>
<p>Edit: I've tried testing it local and it does work if I go to the right folder <code>cd ../base</code>, so I added this to the command, but it makes no difference. It still says it can't find the command</p>
<p>Edit 2: I overlooked an error and it seems te gitlab runner is not running. Stil don't know how to solve this
<code>Error response from daemon: Cannot link to a non running container</code></p>
",https://stackoverflow.com/questions/74795486/gitlab-ci-service-command-not-running,"['docker', 'yaml', 'continuous-integration', 'gitlab-ci']",92,False,0,0
"Can I reuse a captured value in a subsequent mock, with EasyMock?","<p>I'm trying to do E2E testing (or as close as I can get to E2E) for a Jetty application. I have a neat set-up involving testcontainers and minimal mocking, and everything works in principle, except that I am now having to mock the HTTP workflow that would be handled by Jetty, because I run my tests with JUnit, and all of this because I need to test methods that require authentication -- and yes, I <em>could</em> mock the authentication layer, but I'd rather not for reasons.</p>
<p>Anyway, this is what I'm ending up doing:</p>
<pre class=""lang-java prettyprint-override""><code>String someSegueAnonymousUserId = &quot;9284723987anonymous83924923&quot;;

HttpSession httpSession = createNiceMock(HttpSession.class);
// At first, an anonymous user is &quot;created&quot;
expect(httpSession.getAttribute(Constants.ANONYMOUS_USER)).andReturn(null).atLeastOnce();
expect(httpSession.getId()).andReturn(someSegueAnonymousUserId).atLeastOnce();
replay(httpSession);

Capture&lt;Cookie&gt; capturedCookie = Capture.newInstance(); // new Capture&lt;Cookie&gt;(); seems deprecated

// This is the HTTP request for the login step
HttpServletRequest loginRequest = createNiceMock(HttpServletRequest.class);
expect(loginRequest.getSession()).andReturn(httpSession).atLeastOnce();
replay(loginRequest);

// The login process takes the auth cookie and sticks it into the HTTP response
// I capture the cookie because I'm going to need it for subsequent requests, to prove that I'm logged in
HttpServletResponse loginResponse = createNiceMock(HttpServletResponse.class);
loginResponse.addCookie(and(capture(capturedCookie), isA(Cookie.class)));
expectLastCall().atLeastOnce();
replay(loginResponse);

// This is the request for the endpoint I'm going to test
HttpServletRequest createBookingRequest = createNiceMock(HttpServletRequest.class);
// I expect that the endpoint method will check authentication by grabbing the cookies from the request
// Test case fails here: I can't find a way to cast the Object[] returned by the toArray() method to a Cookie[] which is what getCookies() is expected to return.
expect(createBookingRequest.getCookies()).andReturn((Cookie[]) Collections.singletonList(capturedCookie).toArray()).atLeastOnce();
replay(createBookingRequest);

// OK, so, this logs me in, and it works just fine, the cookie is created, and it is valid as far as I can tell
RegisteredUserDTO testUsers = userAccountManager.authenticateWithCredentials(loginRequest, loginResponse, AuthenticationProvider.SEGUE.toString(), &quot;test-account@test.com&quot;, &quot;testpassword&quot;, false);
// I don't even get here at all because of that failure above
Response createBookingResponse = eventsFacade.createBookingForMe(createBookingRequest, &quot;someEventId&quot;, null);
</code></pre>
<p>Now, either there is a way of fixing this, or I'm doing it terribly wrong and I should be doing things very differently. However, I can't find much guidance on the Internet, so my suspicion that I'm doing something that I'm not supposed to do.</p>
<p>Any pointers to how I should do things differently?</p>
",https://stackoverflow.com/questions/72718145/can-i-reuse-a-captured-value-in-a-subsequent-mock-with-easymock,"['java', 'http', 'cookies', 'junit', 'easymock']",242,True,1,1
Difference in running one and many files in jest,"<p>I'm using jest (<code>^28.1.3</code>) for running unit and e2e tests on backend (Apollo Server, TypeORM and PostgreSQL). There aren't problems to run unit tests (one file, two or all), but I have a problem with e2e testing.</p>
<h4>On local machine</h4>
<ul>
<li>If I run one file with e2e tests (e.g. <code>regression.e2e-spec.ts</code>), I'll get an error.</li>
<li>If I run two files (e.g. <code>regression.e2e-spec.ts</code> + <code>someUnit.test.ts</code>, or <code>regression.e2e-spec.ts</code> + <code>otherE2ETest.e2e-spec.ts</code>), I won't get any error, testing will finished successful.</li>
</ul>
<h4>On GitHub Actions</h4>
<ul>
<li>I get same error in any cases (run one, two or all files)</li>
</ul>
<p>May jest execute tests in main process/thread when it finds only one file? And split execution on several process when find several files?
The problem might be in an isolation, with one file environment isn't clean.</p>
<p>Files are filtered in jest.config.js, write file name in testMatch.</p>
<pre class=""lang-js prettyprint-override""><code>/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
  roots: ['&lt;rootDir&gt;/src'],
  testEnvironment: 'node',
  testMatch: ['**/src/**/*.(test|e2e-spec).ts'], // keep in sync with src/__test__/setup/E2ERegExp.ts
  globalSetup: './src/__test__/setup/globalSetup.ts',
  globalTeardown: './src/__test__/setup/globalTeardown.js',
  setupFilesAfterEnv: ['./src/__test__/setup/setup.ts'],
  transform: {
    '^.+\\.ts': 'ts-jest',
  },
};
</code></pre>
<p>In <code>globalSetup</code> and <code>globalTeardown</code> I setup and drop databases. In <code>setup.ts</code> run server and connect to db.</p>
<p>Tests are executed in parallel.</p>
<pre><code> &quot;docker:test&quot;: &quot;RUN_DB=true NODE_OPTIONS=--max-old-space-size=4096 jest --colors --maxWorkers=50%&quot;,
</code></pre>
",https://stackoverflow.com/questions/73869157/difference-in-running-one-and-many-files-in-jest,"['jestjs', 'integration-testing']",120,False,0,0
Node module type declarations clash in Typescript,"<p>I'm trying to setup unit testing and e2e testing for my Vue 3 project. For Unit test I use Jest and for e2e test I use Nightwatch.  I'm confronting this below problem after installed both dependencies:
&quot;
node_modules/@types/jest/index.d.ts:45:15 - error TS2451: Cannot redeclare block-scoped variable 'expect'.</p>
<p>45 declare const expect: jest.Expect;
~~~~~~</p>
<p>node_modules/@types/nightwatch/globals.d.ts:11:11
11     const expect: typeof chaiExpect;
~~~~~~
'expect' was also declared here.</p>
<p>node_modules/@types/nightwatch/globals.d.ts:11:11 - error TS2451: Cannot redeclare block-scoped variable 'expect'.</p>
<p>11     const expect: typeof chaiExpect;
~~~~~~</p>
<p>node_modules/@types/jest/index.d.ts:45:15
45 declare const expect: jest.Expect;
~~~~~~
'expect' was also declared here.</p>
<p>Found 2 errors in 2 files.</p>
<p>Errors  Files
1  node_modules/@types/jest/index.d.ts:45
1  node_modules/@types/nightwatch/globals.d.ts:11&quot;</p>
<p>So far I have tried this solution to override the node module's type definition: <a href=""https://medium.com/@elenasufieva/handling-type-declarations-clash-in-typescript-b05b10723f47"" rel=""nofollow noreferrer"">https://medium.com/@elenasufieva/handling-type-declarations-clash-in-typescript-b05b10723f47</a></p>
<p>but it didn't work.</p>
",https://stackoverflow.com/questions/74150769/node-module-type-declarations-clash-in-typescript,"['typescript', 'vue.js', 'unit-testing', 'jestjs', 'nightwatch']",21,False,0,0
Does it make sense to have angular Cypress e2e testing within an own repository?,"<p>I have a few questions regarding angular (with a PHP Laravel backend) e2e testing with cypress.</p>
<ol>
<li>In my company we have the idea to have our cypress e2e tests in an extra repository so all people (backend, QA) could also write and edit tests.
I am not sure if that's such a good idea, because it feels odd to have the test not at the source code. But on the other hand, e2e also tests the backend, so it isn’t next to the source anyway. What are the best practices for Angular here? We have no staff for testing. Just front/backend developers and QA people who don’t write tests currently.</li>
<li>Is it a good Idea to have the exact same tests for e2e and integration? In my opinion, these are two different test sets and I shouldn’t just use the e2e tests with mock data to have my integration testing.</li>
</ol>
<p>Thanks in Advance!</p>
",https://stackoverflow.com/questions/73850585/does-it-make-sense-to-have-angular-cypress-e2e-testing-within-an-own-repository,"['angular', 'cypress', 'e2e-testing']",196,True,1,1
How to integration test calls to the ExpoSDK APIs,"<p>My app makes calls to Expo SQLite for data persistence.
I have good unit test coverage for my business logic.</p>
<p>I want tests to make sure my calls to the Expo SQLite API as well as my SQL queries are functioning correctly in edge cases.</p>
<p>I've considered:</p>
<ul>
<li>Snapshot testing seems to be very coupled to logic inside React components. And don't have access to ExpoSDK APIs.</li>
<li>E2E testing with Appium and Selenium seem more focused on how the UI looks.</li>
<li>I could make mocks for ExpoSDK modules, but this involves a lot of effort and potential maintenance that is sort of tangential to testing. Also this approach causes coupling the the implementation of my classes instead of to the result/business rules.</li>
</ul>
<p>I'm imagining a testing framework that will run my tests on a mobile simulator, and make a React Native View that displays the test results. <a href=""https://mochajs.org/#reporting"" rel=""nofollow noreferrer"">Similar to what Mocha does in the browser.</a> Is anyone aware of such a testing framework for React Native?</p>
",https://stackoverflow.com/questions/73655680/how-to-integration-test-calls-to-the-exposdk-apis,"['reactjs', 'react-native', 'unit-testing', 'automated-tests', 'expo']",15,False,0,0
Cypress - how to describe a multiple step test,"<p>This is probably an anti-pattern, but I'm new to e2e testing and I'm not sure there's a way around my requirements.</p>
<p>I have the need to test a scenario in my system that is several steps long (maybe 50-60 steps). This means going to about 15-20 pages, clicking and entering various details, and seeing the results. The reason the requirement is so long is that the system processes orders from creating an order, creating line items with various details, and running it through a long production process. My most valuable test would be to run through the whole process and verify the results.</p>
<p>I can't find a good way of isolating, say, steps 40-42 to verify that this process alone works well, because to get an order in that state I'd have to run through the first 39 steps.</p>
<p>Is there a good way to write tests to cover this scenario?</p>
",https://stackoverflow.com/questions/71229252/cypress-how-to-describe-a-multiple-step-test,['cypress'],61,False,0,0
Execution failed for task &#39;:vision-camera-code-scanner:checkDebugAndroidTestAarMetadata&#39;,"<p>So I have been at this for a while now, I recently tried to add Detox tests to android in my react native projects.</p>
<p>I followed the official Detox tutorial and this one
<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> But when I'm trying to build the project <code>detox build -c android.emu.debug</code> I keep getting this exception:</p>
<blockquote>
<p>FAILURE: Build failed with an exception.</p>
<p>Execution failed for task
':vision-camera-code-scanner:checkDebugAndroidTestAarMetadata'. A
failure occurred while executing
com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction The
minCompileSdk (31) specified in a dependency's AAR metadata
(META-INF/com/android/build/gradle/aar-metadata.properties) is greater
than this module's compileSdkVersion (android-30). Dependency:
androidx.camera:camera-extensions:1.1.0-beta02. AAR metadata file:
./directory-location/aar-metadata.properties.</p>
</blockquote>
<p>I kept looking online and all I found was this 2 pages</p>
<p><a href=""https://github.com/mrousavy/react-native-vision-camera/issues/934"" rel=""nofollow noreferrer"">https://github.com/mrousavy/react-native-vision-camera/issues/934</a></p>
<p><a href=""https://groups.google.com/a/android.com/g/camerax-developers/c/Gc4yAR2l9I0"" rel=""nofollow noreferrer"">https://groups.google.com/a/android.com/g/camerax-developers/c/Gc4yAR2l9I0</a></p>
<p>But it didn't help because my compileSdkVersion is already 31 as well as my targetSdkVersion...</p>
<p>I will really appreciate it if you help me, tnx.</p>
",https://stackoverflow.com/questions/72143745/execution-failed-for-task-vision-camera-code-scannercheckdebugandroidtestaarm,"['android', 'react-native', 'testing', 'build', 'detox']",2886,True,3,1
How do you test React components that just display data in a meaningful way?,"<p>I have a simple two-page app. One page fetches data from an API and displays a graph from that data. The other page fetches movie data from an API and maps each data object to a MovieCard component and displays that on the page.</p>
<p>I am trying to write tests for this app to make sure everything is working as intended. Usually when I test components, I use Jest to test that certain functions inside the component provide expected outputs on given inputs. But in this case there isn't really any input/output, so I'm not sure what I'm meant to be testing.</p>
<p>How do you test a component which fetches data from an API and displays it on the screen? Or a component which fetches data from an API and displays a graph? What should I be testing to make sure this application is working correctly? Is this unit/integration/e2e testing? Can I write basic 'expect x toBe y' in Jest? Is it as simple as just checking if a certain DOM element is indeed rendered onto the screen?</p>
",https://stackoverflow.com/questions/73114991/how-do-you-test-react-components-that-just-display-data-in-a-meaningful-way,['reactjs'],23,False,0,0
Fix Library not loaded: @rpath/hermes.framework/hermes in GitHub action macos-12 runner,"<p>We want to run e2e testing within GitHub action for ou React Native iOS application.</p>
<p>We use <code>macos-12</code> GitHub runner for running test, and building the iOS simulator build.</p>
<p>Build steps succeed locally and in the runner.</p>
<p>The build from the runner does not work both in the runner and locally, while my local build work fine in the runner and locally.</p>
<p>This is the debug log I get from the runner when trying to launch the builded app within the simulator in the CI : <a href=""https://gist.github.com/kopax-polyconseil/cd31322d8d71b664a0c965be7a1607e0#file-ios-log-L28"" rel=""nofollow noreferrer"">https://gist.github.com/kopax-polyconseil/cd31322d8d71b664a0c965be7a1607e0#file-ios-log-L28</a></p>
<p>The relevant part is:</p>
<pre><code>Library not loaded: @rpath/hermes.framework/hermes
Referenced from: /Users/USER/Library/Developer/CoreSimulator/Devices/7C23C39D-FA27-425C-9B5C-FB06AC4A982C/data/Containers/Bundle/Application/61E9F720-7C7A-4822-9B34-F52954645757/PassCulture.app/PassCulture
Reason: tried: '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.2.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/hermes.framework/hermes' (no such file), '/usr/lib/swift/hermes.framework/hermes' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.2.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/hermes.framework/hermes' (no such file), '/usr/lib/swift/hermes.framework/hermes' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.2.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/hermes.framework/hermes' (no such file), '/usr/lib/swift/hermes.framework/hermes' (no such file), '/Users/dka/Library/Developer/CoreSimulator/Devices/7C23C39D-FA27-425C-9B5C-FB06AC4A982C/data/Container
(terminated at launch; ignore backtrace)
</code></pre>
<p>These are related issue I have found:</p>
<ul>
<li><a href=""https://stackoverflow.com/questions/70875239/library-not-loaded-rpath-hermes-framework-hermes/73644327#73644327"">Library not loaded: @rpath/hermes.framework/hermes</a></li>
<li><a href=""https://github.com/facebook/react-native/issues/34601"" rel=""nofollow noreferrer"">https://github.com/facebook/react-native/issues/34601</a></li>
</ul>
<p>It seems hermes is not found when starting the app within the simulator.</p>
<p>We use react-native 0.68.5, the GitHub action CI takes 2hours to perform this build and it is painful.</p>
<p>All proposed workaround I found tells how to configure xcode with a GUI, which is not possible in the GitHub action environment.</p>
<p>How can I fix this hermes problem in a CI environment ?</p>
",https://stackoverflow.com/questions/74653816/fix-library-not-loaded-rpath-hermes-framework-hermes-in-github-action-macos-12,"['ios', 'swift', 'react-native', 'github-actions', 'react-native-hermes']",81,False,0,0
dotnet dotcover run not giving a coverage result for blazor app,"<p>installed dotcover tool globally trying to run a blazor wasm project using
In admin powershell:</p>
<pre><code>dotnet dotcover run --dcOutput=D:\output.xml --dcReportType=XML
</code></pre>
<p>This runs the application ok and I get</p>
<pre><code>[JetBrains dotCover] Coverage session started [11/20/2022 10:01:19 PM]. 
</code></pre>
<p>The file does not seem to get generated though. I attempted same with the console app dotcover.exe and cover-everything option.</p>
<pre><code>.\dotcover.exe cover-everything --Output=D:\output.xml --ReportType=XML --StartInstance=123
JetBrains dotCover Console Runner 2022.2.4. Build 777.0.20221024.174408
Copyright (c) 2009-2022 JetBrains s.r.o. All rights reserved.
[JetBrains dotCover] Starting instance with parameters: 'cover-everything --Output=D:\output.xml --ReportType=XML /Instance:123' [11/20/2022 10:30:31 PM]

  JetBrains dotCover Console Runner 2022.2.4. Build 777.0.20221024.174408
  Copyright (c) 2009-2022 JetBrains s.r.o. All rights reserved.
  [JetBrains dotCover] Coverage session started [11/20/2022 10:30:32 PM]
  [JetBrains dotCover] Instance started and ready to accept commands: InstanceId='123', Port=63035 [11/20/2022 10:30:37 PM]
.\dotcover.exe send --Instance=123 --Command=GetSnapshotAndKillChildren
JetBrains dotCover Console Runner 2022.2.4. Build 777.0.20221024.174408
Copyright (c) 2009-2022 JetBrains s.r.o. All rights reserved.
[JetBrains dotCover] Coverage session finished but no snapshots were created.
</code></pre>
<p>The goal I am trying to achieve is setting up a testserver that serves the wasm app and then have dotcover collect coverage for both client-side and serverside code as it is used. The intended purpose of this is to set up a locally served webpage for E2E testing with e.g Playwright, selenium or similar test frameworks. I see that there is support for bUnit, but that seems only intended to be used for unit tests.</p>
<p>I would expect that if this worked, dotcover would collect coverage whenever I clicked around on the page and/or fetched data from backend.</p>
<p>Is what I am trying to achieve even a supported usecase for dotcover? Are there alternatives that have been used to achieve the same thing?</p>
",https://stackoverflow.com/questions/74512237/dotnet-dotcover-run-not-giving-a-coverage-result-for-blazor-app,"['.net', 'blazor', 'dotcover']",108,False,0,0
"Nest JS and the database, via TypeORM","<p>I am new to the typeORM support with Nest JS. All the examples I have been following online always define the database connection in the <code>app.module.ts</code>.</p>
<p>My backend supports many different functions, and I want it to be able to run without the database and function, but routes requiring the database can then return errors to try later or potentially some locally cached data.</p>
<p>Current configuration for <code>app.module.ts</code> to get connection to the database:
<code>app.module.ts</code></p>
<pre><code>imports: [
    ConfigModule.forRoot({
        cache: true,
        expandVariables: true,
        isGlobal: true,
    }),
    TypeOrmModule.forRoot({
        type: 'mysql',
        host: 'localhost',
        port: 3306,
        username: 'myuser',
        password: 'mypass',
        database: 'mydb',
        entities: [],
        synchronize: false,
    }),
],
</code></pre>
<p>Is it possible to load the typeORM in lazy-loaded modules, as the <code>.forFeature()</code> seems to be for a repository, not the overall database setup (connection).  Can I simply do the <code>typeORM.forRoot(...)</code> in any module definition? This would make the <code>app.module.ts</code> look something like:</p>
<pre><code>imports: [
    ConfigModule.forRoot({
        cache: true,
        expandVariables: true,
        isGlobal: true,
    }),
    DatabaseModule,
],
</code></pre>
<p>and then a <code>database.module.ts</code></p>
<pre><code>imports: [
    ConfigModule,
    TypeOrmModule.forRoot({
        type: 'mysql',
        host: 'localhost',
        port: 3306,
        username: 'myuser',
        password: 'mypass',
        database: 'mydb',
        entities: [],
        synchronize: false,
    }),
</code></pre>
<p>If the above can be done, what is the impact if a couple of lazy loaded modules are trying the same initialization? I assume this would be a problem, and I would be better having a shared module for the database, and that module is the only thing loading the typeORM, and then export the connection and services, which could be imported into another module?</p>
<p>I also want to do something similar so my E2E testing, which runs against the NestJS application, will not need the database defined for the modules that do not use it. As it is in <code>app.module.ts</code> now, all my E2E tests fail as soon as I try to use the database, since it does not exist in the test environment (yet).</p>
",https://stackoverflow.com/questions/71653792/nest-js-and-the-database-via-typeorm,"['typescript', 'nestjs', 'typeorm']",802,False,0,0
Cypress for Components Tests React configuration problem absolute path,"<p>the goal is to use Cypress for component testing and e2e testing mainly.
Install and configure all Cypress correctly, configure Cypress in the 'cypress open' script to open E2E related tests and configure the 'cypress open-ct' script for component tests, all settings work very well.</p>
<h3>Problem</h3>
<p>The project is already ready and I have absolute folders configuration, when I import a component from '~/components' I am accessing 'src/components', I am not able to make the proper settings to be able to access the absolute folders because when I run the cypress open script -ct doesn't seem to run 'file:preprocessor', where you need to run it to run the webpack where you have the absolute folder settings.
I tried several alternatives and this was the one that worked the best because when I run the 'cypress open' script cypress executes 'file:preprocessor' it applies the webpack settings and if I try to import a component using '~/component/InputDate' it works , however 'cypress open' is for E2E tests, I can't run unit tests through this script.<br />
I can be wrong about the cypress open script not running component tests correctly but I'm looking for a solution to the big problem that is these absolute folders.</p>
<h3>Attempts</h3>
<p>I tried the tsconfig.json files configuration solution but I couldn't make it work because I use it in the jsconfig.json project, I tried to use tsconfig.json I used the 'tsconfig-paths' package and got no result.</p>
<h3>cypress/plugins/index.js</h3>
<pre><code>const webpack = require('@cypress/webpack-preprocessor')

const injectDevServer = require('@cypress/react/plugins/react-scripts')

module.exports = (on, config) =&gt; {
  const options = {
    webpackOptions: require('../../webpack.config.js'),
    watchOptions: {},
  }
  on('file:preprocessor', webpack(options))

  injectDevServer(on, config)

  return config
}
</code></pre>
<h3>cypress.json</h3>
<pre><code>{
  &quot;component&quot;: {
    &quot;componentFolder&quot;: &quot;src/tests/components&quot;
  },
  &quot;integrationFolder&quot;: &quot;src/tests/integration&quot;
}

</code></pre>
<h3>webpackconfig.js</h3>
<pre><code>var path = require('path')

module.exports = {
  mode: 'development',
  module: {
    rules: [
      {
        test: /\.js$|jsx/,
        exclude: [/node_modules/],
        use: [
          {
            loader: 'babel-loader',
            options: {
              presets: ['@babel/preset-env', '@babel/preset-react'],
            },
          },
        ],
      },
    ],
  },
  resolve: {
    alias: {
      '~': path.resolve(__dirname, 'src'),
    },
  },
}

</code></pre>
<h3>packjage.json</h3>
<pre><code>&quot;devDependencies&quot;: {
    &quot;@cypress/react&quot;: &quot;5.12.4&quot;,
    &quot;@cypress/webpack-dev-server&quot;: &quot;1.8.3&quot;,
    &quot;@cypress/webpack-preprocessor&quot;: &quot;^5.11.1&quot;,
    &quot;@types/jwt-decode&quot;: &quot;^3.1.0&quot;,
    &quot;babel-loader&quot;: &quot;^8.2.3&quot;,
    &quot;cypress&quot;: &quot;9.5.2&quot;,
    &quot;webpack-dev-server&quot;: &quot;3.2.1&quot;
  }
</code></pre>
",https://stackoverflow.com/questions/71519177/cypress-for-components-tests-react-configuration-problem-absolute-path,"['javascript', 'reactjs', 'webpack', 'cypress', 'cypress-component-test-runner']",1584,True,1,1
Bulding process of a Docker container for Gauge Framework wont stop running,"<p>I write my bachelor thesis about E2E-Testing of a specific software for my university. I work with the <a href=""https://docs.gauge.org/index.html?os=windows&amp;language=javascript&amp;ide=vscode"" rel=""nofollow noreferrer"">Gauge-framework</a> which includes Taiko. My tests are fine and working on my local machine.</p>
<p>But now I have to build a docker Container because my tests have to work autonomously regardless of which OS is in use (my mentor uses IoS and there are some problems if he just runs my code from GitLab).</p>
<p>And know the problem:
I read a bit about docker and watched some tutorials how to use it. Therefore, I understand  what is happening in the following code to some extent. The docker file is generated when I initialize a gauge project. There is antoher dockerfile example on the gauge hompage but that doesn´t work too (it is from 2018 and maybe outdated but not changed on the doc site).</p>
<p>`</p>
<pre><code># Building the image
#   docker build -t gauge-taiko .
# Running the image
#   docker run  --rm -it -v ${PWD}/reports:/gauge/reports gauge-taiko

# This image uses the official node base image.
FROM node
 
# The Taiko installation downloads and installs the chromium required to run the tests. 
# However, we need the chromium dependencies installed in the environment. These days, most 
# Dockerfiles just install chrome to get the dependencies.
RUN apt-get update \
     &amp;&amp; apt-get install -y wget gnupg ca-certificates \
     &amp;&amp; wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
     &amp;&amp; sh -c 'echo &quot;deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main&quot; &gt;&gt; /etc/apt/sources.list.d/google.list' \
     &amp;&amp; apt-get update \
     &amp;&amp; apt-get install -y google-chrome-stable

 
# Set a custom npm install location so that Gauge, Taiko and dependencies can be 
# installed without root privileges
ENV NPM_CONFIG_PREFIX=/home/gauge/.npm-packages
ENV PATH=$PATH:/home/gauge/.npm-packages/bin

# ENV PATH=$PATH:/home/node/.npm-global/bin

# Add the Taiko browser arguments
ENV TAIKO_BROWSER_ARGS=--no-sandbox,--start-maximized,--disable-dev-shm-usage
ENV headless_chrome=true
ENV TAIKO_SKIP_DOCUMENTATION=true

# Uncomment the lines below to use chrome bundled with this image
#ENV TAIKO_SKIP_CHROMIUM_DOWNLOAD=true
#ENV TAIKO_BROWSER_PATH=/usr/bin/google-chrome
 
# Set working directory
WORKDIR /gauge
 
# Copy the local working folder
COPY . .

# Create an unprivileged user to run Taiko tests
RUN groupadd -r gauge &amp;&amp; useradd -r -g gauge -G audio,video gauge &amp;&amp; \
   mkdir -p /home/gauge/.npm-packages/lib &amp;&amp; \
   chown -R gauge:gauge /home/gauge /gauge
 
USER gauge



# Install dependencies and plugins 
RUN npm install -g @getgauge/cli &amp;&amp; \
    gauge install js &amp;&amp; \
    gauge install html-report &amp;&amp;  \
    gauge install screenshot &amp;&amp; \
    gauge config check_updates false

# Default command on running the image
ENTRYPOINT [&quot;npm&quot;, &quot;test&quot;]
</code></pre>
<p>`
and then the bulding process wont stop (see below):</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-html lang-html prettyprint-override""><code>=&gt; [internal] load build definition from Dockerfile                                                                                                                                                                      0.2s 
 =&gt; =&gt; transferring dockerfile: 2.03kB                                                                                                                                                                                    0.0s 
 =&gt; [internal] load .dockerignore                                                                                                                                                                                         0.2s 
 =&gt; =&gt; transferring context: 34B                                                                                                                                                                                          0.0s 
 =&gt; [internal] load metadata for docker.io/library/node:latest                                                                                                                                                            0.6s 
 =&gt; [internal] load build context                                                                                                                                                                                         0.1s 
 =&gt; =&gt; transferring context: 1.44kB                                                                                                                                                                                       0.0s 
 =&gt; [1/6] FROM docker.io/library/node@sha256:d5222e1ebd7dd7e9683f47a8861a4711cb4407a4830cbe04a582ca4986245700                                                                                                             0.0s 
 =&gt; CACHED [2/6] RUN apt-get update      &amp;&amp; apt-get install -y wget gnupg ca-certificates      &amp;&amp; wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -      &amp;&amp; sh -c 'echo ""deb [arch=amd6  0.0s 
 =&gt; CACHED [3/6] WORKDIR /gauge                                                                                                                                                                                           0.0s 
 =&gt; CACHED [4/6] COPY . .                                                                                                                                                                                                 0.0s 
 =&gt; CACHED [5/6] RUN groupadd -r gauge &amp;&amp; useradd -r -g gauge -G audio,video gauge &amp;&amp;    mkdir -p /home/gauge/.npm-packages/lib &amp;&amp;    chown -R gauge:gauge /home/gauge /gauge                                             0.0s 
 =&gt; CANCELED [6/6] RUN npm install -g @getgauge/cli &amp;&amp;     gauge install js &amp;&amp;     gauge install html-report &amp;&amp;      gauge install screenshot &amp;&amp;     gauge config check_updates false                                    31.3s</code></pre>
</div>
</div>
</p>
<p>It let it run for about 10 minutes but nothing happened and I cnaceled it by myself.</p>
<p>After some tests and research, I think the problem is this line</p>
<blockquote>
<p>npm install -g @getgauge/cli &amp;&amp;</p>
</blockquote>
<p>I changed the order of how the commands are executed (e.g. if I execute gauge install js first with a particlar <code>RUN</code> command it executes. Then it stops at the command line above again).</p>
<p>Then I ran antoher test and tried to install a specific version of Gauge with the <em>npm install -g @getgauge/cli@Version</em> command (in my test it was 1.1.1 because I have seen that in a GitHub example) and with that it worked. However, the current version is 1.4.4 and I use that version on my local machine and, therefore, want to use it within the Docker Container (plus there were some pretty usefull bugfixes in between these versions ...). Do you have any ideas how I can fix that problem or give me a hint about how to fix it or where to look up some information?</p>
<p>Tahnk you guys and have happy holidays!</p>
",https://stackoverflow.com/questions/74898268/bulding-process-of-a-docker-container-for-gauge-framework-wont-stop-running,"['docker', 'docker-build', 'gauge', 'getgauge']",78,False,0,0
".NET 6 E2E tests with test server fail on TeamCity CI, but work run manually","<p>I have a .NET 6 app (with ASP.NET Core web part). I use <a href=""https://www.cypress.io/"" rel=""nofollow noreferrer"">cypress</a> for E2E testing. After we migrated to .NET 6 from .NET Framework, I wanted to run E2E cypress tests on the web application.</p>
<p>My process is that I actually run nUnit tests in C# that initialize the in-memory SQLite database and then use this database connection for my app. I use such an approach to create data needed for E2E tests before the actual tests are run. Then I run cypress from C# unit test. This all worked fine in .NET Framework, where the web application was actually run during the tests, so it was available on a real URL within IIS.</p>
<p>With .NET 6, we have <code>WebApplicationFactory</code> <a href=""https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.testing.webapplicationfactory-1?view=aspnetcore-6.0"" rel=""nofollow noreferrer"">class</a> that allows running the app in-memory. However, I wanted my web application to be available under a real URL with a real port, so I can launch cypress tests against it.</p>
<p>After exploring various ideas from <a href=""https://github.com/dotnet/aspnetcore/issues/4892"" rel=""nofollow noreferrer"">this GitHub discussion</a>, I created a factory of real test apps (with real IP and port):</p>
<pre class=""lang-cs prettyprint-override""><code>public abstract class RealTestServerWebAppFactory&lt;TStartup&gt; : WebApplicationFactory&lt;TStartup&gt; where TStartup : class
{
    private bool _disposed;
    private IHost _host;

    public RealTestServerWebAppFactory()
    {
        ClientOptions.AllowAutoRedirect = false;
        ClientOptions.BaseAddress = new Uri(&quot;http://localhost&quot;);
    }
    
    public string ServerAddress
    {
        get
        {
            EnsureServer();
            return ClientOptions.BaseAddress.ToString();
        }
    }
    
    public override IServiceProvider Services
    {
        get
        {
            EnsureServer();
            return _host!.Services!;
        }
    }
    
    // Code created with advices from https://github.com/dotnet/aspnetcore/issues/4892
    protected override void ConfigureWebHost(IWebHostBuilder builder)
    {
        base.ConfigureWebHost(builder);
        
        // Final port will be dynamically assigned
        builder.UseUrls(&quot;http://127.0.0.1:0&quot;);
        
        builder.ConfigureServices(ConfigureServices);
    }
    
    protected override IHost CreateHost(IHostBuilder builder)
    {
        // Create the host for TestServer now before we
        // modify the builder to use Kestrel instead.
        var testHost = builder.Build();

        // Modify the host builder to use Kestrel instead
        // of TestServer so we can listen on a real address.
        builder.ConfigureWebHost(webHostBuilder =&gt; webHostBuilder.UseKestrel());

        // Create and start the Kestrel server before the test server,
        // otherwise due to the way the deferred host builder works
        // for minimal hosting, the server will not get &quot;initialized
        // enough&quot; for the address it is listening on to be available.
        // See https://github.com/dotnet/aspnetcore/issues/33846.
        _host = builder.Build();
        _host.Start();

        // Extract the selected dynamic port out of the Kestrel server
        // and assign it onto the client options for convenience so it
        // &quot;just works&quot; as otherwise it'll be the default http://localhost
        // URL, which won't route to the Kestrel-hosted HTTP server.
        var server = _host.Services.GetRequiredService&lt;IServer&gt;();
        var addresses = server.Features.Get&lt;IServerAddressesFeature&gt;();

        ClientOptions.BaseAddress = addresses!.Addresses
            .Select(x =&gt; new Uri(x))
            .Last();

        // Return the host that uses TestServer, rather than the real one.
        // Otherwise the internals will complain about the host's server
        // not being an instance of the concrete type TestServer.
        // See https://github.com/dotnet/aspnetcore/pull/34702.
        testHost.Start();
        return testHost;
    }

    protected override void Dispose(bool disposing)
    {
        base.Dispose(disposing);

        if (!_disposed)
        {
            if (disposing)
            {
                _host?.Dispose();
            }

            _disposed = true;
        }
    }

    protected abstract void ConfigureServices(IServiceCollection services);

    /// &lt;summary&gt;
    /// Makes sure that the server has actually been run.
    /// It must be executed at lest once to have the address and port assigned and the app fully working
    /// &lt;/summary&gt;
    private void EnsureServer()
    {
        if (_host is null)
        {
            using var _ = CreateDefaultClient();
        }
    }
}
</code></pre>
<p>Then I create a class deriving from <code>RealTestServerWebAppFactory</code>, where I set up some test dependency injection, but this nothing important for our example. Let's call this child class <code>MyServerTestApp</code>.</p>
<p>An instance creation in the tests looks as follows:</p>
<pre class=""lang-cs prettyprint-override""><code>var serverTestApp = new MyServerTestApp();
serverTestApp.ServerAddress;
</code></pre>
<p>At the second line, <code>EnsureServer()</code> method is called which creates a default client for the app. It also calls <code>CreateHost(IHostBuilder builder)</code> from <code>RealTestServerWebAppFactory</code> class which does all the magic. Locally, after this line I have the URL for the app and I can access it via a web browser (or E2E tests).</p>
<p>Now, the problem is that the tests work fine locally. However, I also execute them on CI - TeamCity to be more precise. The <code>dotnet test</code> command used to run those tests by TeamCity looks as follows:</p>
<pre><code>&quot;C:\Program Files\dotnet\dotnet.exe&quot; test C:\TeamCity\buildAgent\work\c9a5fb5bca7f6666\Tests\E2ETests\bin\Release\net6.0-windows\MyApp.E2ETests.dll /logger:logger://teamcity /TestAdapterPath:C:\TeamCity\buildAgent\plugins\dotnet\tools\vstest15 /logger:console;verbosity=normal
</code></pre>
<p>which is in fact quite straightforward use of <code>dotnet test</code> command. However, these tests fail executed by TeamCity with the following exception:</p>
<pre><code>[12:47:54][dotnet test] A total of 1 test files matched the specified pattern.
[12:47:56][dotnet test] NUnit Adapter 4.2.0.0: Test execution started
[12:47:56][dotnet test] Running all tests in C:\TeamCity\buildAgent\work\c9a5fb5bca7f6666\Tests\E2ETests\bin\Release\net6.0-windows\MyApp.E2ETests.dll
[12:47:58][dotnet test]    NUnit3TestExecutor discovered 10 of 10 NUnit test cases using Current Discovery mode, Non-Explicit run
[12:48:07][dotnet test] Setup failed for test fixture MyApp.E2ETests.SomeTestsClass
[12:48:07][dotnet test] System.InvalidOperationException : Sequence contains no elements
[12:48:07][dotnet test] StackTrace:    at System.Linq.ThrowHelper.ThrowNoElementsException()
[12:48:07][dotnet test]    at System.Linq.Enumerable.Last[TSource](IEnumerable`1 source)
[12:48:07][dotnet test]    at MyApp.E2ETests.Infrastructure.RealTestServerWebAppFactory`1.CreateHost(IHostBuilder builder) in C:\TeamCity\buildAgent\work\c9a5fb5bca7f6666\Tests\MyApp.E2ETests\Infrastructure\RealTestServerWebAppFactory.cs:line 85
[12:48:07][dotnet test]    at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.ConfigureHostBuilder(IHostBuilder hostBuilder)
[12:48:07][dotnet test]    at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.EnsureServer()
[12:48:07][dotnet test]    at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateDefaultClient(DelegatingHandler[] handlers)
[12:48:07][dotnet test]    at MyApp.E2ETests.Infrastructure.RealTestServerWebAppFactory`1.EnsureServer() in C:\TeamCity\buildAgent\work\c9a5fb5bca7f6666\Tests\MyApp.E2ETests\Infrastructure\RealTestServerWebAppFactory.cs:line 122
[12:48:07][dotnet test]    at MyApp.E2ETests.Infrastructure.RealTestServerWebAppFactory`1.get_ServerAddress() in C:\TeamCity\buildAgent\work\c9a5fb5bca7f6666\Tests\MyApp.E2ETests\Infrastructure\RealTestServerWebAppFactory.cs:line 35
System.InvalidOperationException : Sequence contains no elements
</code></pre>
<p>It seems that this code:</p>
<pre class=""lang-cs prettyprint-override""><code>var addresses = server.Features.Get&lt;IServerAddressesFeature&gt;();
</code></pre>
<p>returns an empty connection of addresses being run by TeamCity. As a consequence, this code:</p>
<pre class=""lang-cs prettyprint-override""><code>ClientOptions.BaseAddress = addresses!.Addresses
            .Select(x =&gt; new Uri(x))
            .Last();
</code></pre>
<p>fails with <code>System.InvalidOperationException : Sequence contains no elements</code>.</p>
<p>What's weird is that if I run those tests using the same <code>dotnet test</code> command as TeamCity does manually using <code>cmd</code>, it works. It works on the same CI machine, but executed manually from <code>cmd</code>, not as TeamCity's build step. The CI machine runs Windows Server 2019.</p>
<p>I've been thinking it might be something related to the rights/permissions of the user used for running TeamCity. However, the Windows Service for TeamCity uses &quot;Local System&quot; account, so it should have all permissions as far as I know.</p>
<p>Any help/ideas are appreciated :)</p>
",https://stackoverflow.com/questions/72434333/net-6-e2e-tests-with-test-server-fail-on-teamcity-ci-but-work-run-manually,"['c#', '.net', 'unit-testing', 'asp.net-core', '.net-core']",661,True,2,1
Django Rest Framework app security preparation for production (Auth and Admin Panel),"<h1>Intro</h1>
<p>I've built a web application with multiple services:</p>
<ul>
<li>frontend (react)</li>
<li>backend (API and admin panel) (Django Rest Framework + simple jwt auth)</li>
<li>Redis, DB, Nginx and etc</li>
<li>Kubernetes cluster</li>
</ul>
<p>The app isn't small like 60k+ lines of code. It's a startup. I mentioned it to let you know that probably I wouldn't have that much attention from hackers or traffic at all. Hence I have a space to improve gradually.</p>
<p>The auth is done with DRF simple jwt library. Expiring Access + Refresh token.</p>
<h1>Problem statement</h1>
<p>I did a security audit and found imperfections from the security architecture perspective. I don't know how those issues are crucial, how should I fix them, or what issues can be fixed later. So I'm seeking solutions and advice. I would prefer an optimal proportion between the speed and quality rather than quality only (If I miss about that let me know) hence if something is &quot;nice to have&quot; rather than &quot;important&quot; I would put it to the backlog of next releases.</p>
<h1>The actual list of issues</h1>
<p>Let's refer by its number if you want to.</p>
<h2>#1 Authentication methods</h2>
<p>My current setup:</p>
<pre><code>REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': (
        'rest_framework.permissions.IsAuthenticated',
    ),
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework.authentication.BasicAuthentication',
        'rest_framework_simplejwt.authentication.JWTAuthentication',
    ),
    .....

}
</code></pre>
<p>As you see I have 3 methods. JWT is ok but BasicAuthentication and SessionAuthentication seem to be not ok. What I want to achieve is to have the real JWT auth and as the only way of auth for the API views (and I did really believe that I had it until I find out the opposite).</p>
<p>As I understood (might be wrong) I don't need SessionAuthentication and BasicAuthentication in the production setting but I do for the dev because it allows me to log in to the DRF API UI with the login form which is cool for testing. Am I right about that?</p>
<h2>#2 Sessions</h2>
<p>When I got to the Chrome Dev Tools and inspected the cookies I was discouraged. At this moment I deprecated the SessionAuthentication and BasicAuthentication as for the test.</p>
<p><a href=""https://i.stack.imgur.com/tncFb.png"" rel=""noreferrer""><img src=""https://i.stack.imgur.com/tncFb.png"" alt=""enter image description here"" /></a></p>
<p>As I understood I have the session id cookie because of the SessionMiddleware. And it's ok to have it because it is used only for the admin panel authentication and ignored by the DRF API views <em>so the only way to auth is JWT</em> but is it? Maybe it can have more impact and exploits. Hence, should I completely drop the SessionMiddleware, especially in order to achieve the goal to have JWT auth as the only auth type?</p>
<p>*I understand that it would abandon the ability to use the Admin Panel feature and I will address this point later.</p>
<h2>#3 I store Access and Refresh tokens in the local storage</h2>
<p>Yeah, seems to be I wrong for that. I admit it. It was the lack of experience in the beginning. The frontend app and tests (I use Cypress) heavily depend on the tokens to be in the local storage but it's feasible to migrate. On another hand, I am just afraid of the new bugs that can appear afterward. Also, I suspect expect migration can be a little painful. The question is how crucial is that and hence should I migrate the token store to the cookies now or I can do it later?</p>
<h2>#4.1 Separation of Admin Panel from the API</h2>
<p>Django Admin panel is awesome we all know but it is tightly coupled to the app. But. Issue #2 has brought me to the idea to separate API and Admin. So since I use Kubernetes the idea is to run the two services. One is API, I imagine it as the same codebase but the settings are different (disabled SessionMiddlware and admin panel). And another service where the admin panel feature is fully enabled. Does it make sense?</p>
<p>*I feel that it smells a little bit of over-engineering to me. So please stop if I am wrong about this.</p>
<p>** Seems to heavily depend on the #2 because if there are no issues and exploits with SessionMiddleware hence there are no strong reasons to do so.</p>
<h2>#4.2 Admin Panel production setup</h2>
<p>I just wonder what are the best security practices for setting up Admin Panel access in prod. I have absolutely bare setup. No captcha. No VPN. Fully vanilla. And the question is what is the most feasible but efficient access setup? I feel that it should be secured somehow. At least /admin to be not a public endpoint (VPN?) but I have no clue how to achieve this. I am on Google Cloud Platform so maybe I can use one of its solutions?</p>
<h1>Outro</h1>
<p>What else security checks do you do before going into production as an engineer? I mean of course, the best way is to hire the security team but I can't do that.</p>
<p>What I've done:</p>
<ul>
<li>made sure that there are no data leaks possibilities with (tests and propper backend and frontend app architecture)</li>
<li>did an extensive acceptance and e2e testing on the auth</li>
<li>ran through the serializer and made sure that there are no exploits (at least visible) (of course a lot of unit and e2e tests)</li>
</ul>
<p>Thanks,
Artem</p>
",https://stackoverflow.com/questions/72379181/django-rest-framework-app-security-preparation-for-production-auth-and-admin-pa,"['django', 'security', 'django-rest-framework', 'jwt', 'django-rest-framework-simplejwt']",953,True,8,1
