title,body,link,tags,view_count,is_answered,score,answer_count
End-to-End testing auto-renewable subscriptions on iOS,"<p>We have been working on native subscription integration within our App and our Backend, but we have difficulty with thorough testing of the final product before it goes to production - namely, the complete flow with various cases using our Backend and Apple Store integration.</p>
<p><strong>We have followed:</strong></p>
<p>Backend documentation:
<a href=""https://developer.apple.com/documentation/appstorereceipts/verifyreceipt"" rel=""nofollow noreferrer"">Verify Receipt</a>,
<a href=""https://developer.apple.com/documentation/storekit/in-app_purchase/validating_receipts_with_the_app_store"" rel=""nofollow noreferrer"">Validating Receipts with the App Store</a>,
<a href=""https://developer.apple.com/documentation/appstoreservernotifications"" rel=""nofollow noreferrer"">App Store Server Notifications</a>,
<a href=""https://developer.apple.com/documentation/appstoreservernotifications/notification_type"" rel=""nofollow noreferrer"">Notification Type</a></p>
<p>Frontend (App) documentation:
<a href=""https://developer.apple.com/documentation/storekit"" rel=""nofollow noreferrer"">StoreKit</a>,
<a href=""https://developer.apple.com/documentation/storekittest"" rel=""nofollow noreferrer"">StoreKit Test</a></p>
<p><a href=""https://developer.apple.com/videos/play/wwdc2020/10659/"" rel=""nofollow noreferrer"">WWDC showcase for local StoreKit testing</a></p>
<p>Sandbox testing:
<a href=""https://developer.apple.com/documentation/storekit/in-app_purchase/testing_in-app_purchases_with_sandbox"" rel=""nofollow noreferrer"">Testing In-App Purchases with Sandbox</a>,
<a href=""https://help.apple.com/app-store-connect/#/dev7e89e149d?sub=dev55ecec74d"" rel=""nofollow noreferrer"">Test in-app purchases</a>,
<a href=""https://help.apple.com/app-store-connect/#/dev8b997bee1"" rel=""nofollow noreferrer"">Create a sandbox tester account</a></p>
<p>The issue we have is, that we have no way of testing the realistic flow before we go to production. Local StoreKit testing mocks backend integration and sandbox is unstable and very limited. Every test we've done using sandbox tester accounts, for every single person that tried it, required restarting a device after the initial login to the sandbox account - otherwise, the purchase kept failing. After that, we often had to restart either device or the app. We have found many similar issues throughout forums and so we're unsure if it's Sandbox that can't be trusted or if the implementation still needs some work.</p>
<p>The question is, then, is there a way to test the app-backend-store integration from the end user's point of view, to ensure that there is proper communication between all 3 systems before we release the build to a broader audience? The sandbox environment has also some limitations when it comes to  AppStore Server Notifications. Is there any way we can test all notifications for auto-renewable subscriptions and not only those available on a sandbox before the app is released? Does the platform allow for more testing cases after the build is approved in the review?</p>
",https://stackoverflow.com/questions/66771284/end-to-end-testing-auto-renewable-subscriptions-on-ios,"['swift', 'testing', 'subscription', 'storekit', 'end-to-end']",100,False,1,0
How to get coverage from external end-to-end testing,"<p>We / Our QA teams use an external testing framework, cucumber on java, to write end-to-end unit tests for projects across various languages. We would like to measure code coverage from running such tests for our Go servers.</p>
<p>E.g. for our python servers, we:</p>
<ol>
<li>Run servers using coverage:</li>
</ol>
<pre><code>coverage run ./src/server.py
</code></pre>
<ol start=""2"">
<li><p>Run the integration / E2E tests as a java application</p>
</li>
<li><p>Kill the python server after testing application is done</p>
</li>
<li><p>Generate test coverage reports using</p>
</li>
</ol>
<pre><code>coverage html
</code></pre>
<p>Is there something similar available on Go?
If not, what are the possible alternatives we should consider?</p>
",https://stackoverflow.com/questions/66023671/how-to-get-coverage-from-external-end-to-end-testing,"['go', 'testing', 'instrumentation']",24,False,1,0
Allow permission dialog in Flutter end-to-end testing in IOS?,"<p>I am using IOS for testing in flutter. When permission dialog appears, how can I grant permission inside testing?</p>
",https://stackoverflow.com/questions/67704259/allow-permission-dialog-in-flutter-end-to-end-testing-in-ios,"['flutter', 'testing']",1342,True,3,1
Mocking APIs in End to End Testing with Detox and React-Native,"<p>Has anyone been able to mock APIs in React-Native when doing end to end testing with Detox.</p>
<p>I tried using MirageJs. I am able to mock the APIs after creating a server with MirageJs and initializing it on App.js. The request is successfully mocked when running the app as normal &quot;react-native run-ios&quot;</p>
<p>However when running the e2e.js file, the API request is not being mocked. In the test file I included the following</p>
<pre><code>let server
beforeEach(() =&gt; {
    server = makeServer()
})

afterEach(() =&gt; {
    server.shutdown()
})
</code></pre>
<p>And the server seems to be created. But the API is not mocked.</p>
<p>Happy to hear from anyone who has been able to mock APIs in detox test using MirageJS or a different approach</p>
",https://stackoverflow.com/questions/68302530/mocking-apis-in-end-to-end-testing-with-detox-and-react-native,"['javascript', 'react-native', 'automated-tests', 'detox', 'miragejs']",457,False,2,0
Effectiveness of end-to-end testing when microservices have independent release schedules?,"<p>I'm part of a 20 odd group of developers who maintain around 7 components (websites and microservices) for a single domain in our company (e.g. delivery tracking domain).</p>
<p>In order to ensure quality, we have a &quot;domain scoped end to end tests&quot;. Our E2E testing however has one problem: our E2E environment can have a component that's on a version that's different from production. The reason for this disparity is the components (e.g. microservice) have their own release schedules.</p>
<p>How do you handle this problem? <a href=""https://stackoverflow.com/questions/44043159/how-do-i-include-end-to-end-tests-across-microservices-into-multiple-continuous?rq=1"">My question is almost similar to this</a></p>
<p>Do you enforce that E2E must be run on the correct microservice versions? If so how?</p>
<p>Or do you accepted the fact that CI and production will never have identical microservice versions and just rely on monitoring production?</p>
<p>Lastly, how important is E2E in your CI/CD pipeline?</p>
<p>Note that I'm only interested in E2E testing of our microservices since it's impossible for me to control when a 3rd party service gets released.</p>
<p>Thanks</p>
",https://stackoverflow.com/questions/70402026/effectiveness-of-end-to-end-testing-when-microservices-have-independent-release,"['testing', 'continuous-integration', 'microservices', 'devops', 'continuous-delivery']",304,True,0,1
End-to-end testing NestJS with Fastify: &quot;@nestjs/platform-express&quot; package is missing&quot; error,"<p>I have fresh NestJS application using Fastify. When trying to <code>npm run test:e2e</code> I got the following error:</p>
<pre><code>[Nest] 14894   - 11/19/2021, 10:29:10 PM   [ExceptionHandler] The &quot;@nestjs/platform-express&quot; package is missing. Please, make sure to install this library ($ npm install @nestjs/platform-express) to take advantage of NestFactory.
  ●  process.exit called with &quot;1&quot;

      12 |     }).compile();
      13 | 
    &gt; 14 |     app = moduleFixture.createNestApplication();
         |                         ^
      15 |     await app.init();
      16 |   });
      17 | 

      at Object.loadPackage (../node_modules/@nestjs/common/utils/load-package.util.js:13:17)
      at TestingModule.createHttpAdapter (../node_modules/@nestjs/testing/testing-module.js:25:56)
      at TestingModule.createNestApplication (../node_modules/@nestjs/testing/testing-module.js:13:43)
      at Object.&lt;anonymous&gt; (app.e2e-spec.ts:14:25)

 RUNS  test/app.e2e-spec.ts

Process finished with exit code 1

</code></pre>
<p>Seems odd, because why would platform-express be needed for fastify-based app?</p>
",https://stackoverflow.com/questions/70041367/end-to-end-testing-nestjs-with-fastify-nestjs-platform-express-package-is-mi,"['node.js', 'typescript', 'nestjs', 'fastify', 'nestjs-fastify']",1864,True,3,1
How can I get the search button textusing PlayWright end to end testing tool,"<p>How can I get the <code>search</code> button text in <code>PlayWright</code> end to end testing tool. I have tried below and getting <code>page.innerText(selector, options)</code> but getting undefined. Can someone please advise why the innerText method is not working here.</p>
<p>//homePage.js</p>
<pre><code>const { expect } = require('@playwright/test');

exports.HomePage = class HomePage {
    constructor(page) {
        this.page = page;
        this.getSearchButton = page.innerText(.RoundButton__root .RoundButton__root--blue');
      }

      async goto() {
        await this.page.goto('https://www.localsearch.com.au/');
      }
      
      async getSearchButtonText() {
        await this.getSearchButton ;
      }
      
}
</code></pre>
<p>//home.js</p>
<pre><code>const { test, expect } = require('@playwright/test');
const { HomePage } = require('../pom/homePage');

    test('Verify Search button text', async ({ page }) =&gt; {
      const homePage = new HomePage(page);
      await homePage.goto();
      const text = await homePage.getSearchButtonText();
      console.log(&quot;Search text::&quot;+text);
     
    });
</code></pre>
",https://stackoverflow.com/questions/69832856/how-can-i-get-the-search-button-textusing-playwright-end-to-end-testing-tool,"['javascript', 'playwright']",178,False,0,0
Are there any differences between MS Edge running on ubuntu or windows for End-to-end testing?,"<p>I'm setting up a e2e test stack with ms Playwright.
It should run in a ci pipeline. Playwright comes with a docker image:  <code>mcr.microsoft.com/playwright:focal</code>
which is bases on Ubuntu 20.04 LTS
I have noticed Edge is not included in the image. Edge (running on windows) is the primaire browser that we have to use for our e2e suit. Basically I want to install edge in the image: <a href=""https://www.microsoftedgeinsider.com/en-us/download/"" rel=""nofollow noreferrer"">https://www.microsoftedgeinsider.com/en-us/download/</a>
My question is: Has anybody experienced differences between running Edge on ubuntu and windows 10 which may impact e2e testing/ user experience.</p>
",https://stackoverflow.com/questions/68035410/are-there-any-differences-between-ms-edge-running-on-ubuntu-or-windows-for-end-t,"['windows', 'ubuntu', 'microsoft-edge', 'end-to-end', 'playwright']",149,False,1,1
Facing the null injector error while trying to perform end to end testing for data service using Jasmine,"<p><strong>Facing the null injector error while trying to perform end to end testing for data service using Jasmine.</strong></p>
<p>NullInjectorError: R3InjectorError(DynamicTestModule)[DatabaseService -&gt; AngularFirestore -&gt; InjectionToken angularfire2.app.options -&gt; InjectionToken angularfire2.app.options]:
NullInjectorError: No provider for InjectionToken angularfire2.app.options!</p>
<p>if I run 'ng test' always shows this error</p>
<pre><code>DatabaseService &gt; should be created
NullInjectorError: R3InjectorError(DynamicTestModule)[DatabaseService -&gt; AngularFirestore -&gt; InjectionToken angularfire2.app.options -&gt; InjectionToken angularfire2.app.options]: 
  NullInjectorError: No provider for InjectionToken angularfire2.app.options!
error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'DatabaseService', 'AngularFirestore', 'InjectionToken angularfire2.app.options', 'InjectionToken angularfire2.app.options' ] })
    at &lt;Jasmine&gt;
    at NullInjector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:915:1)
    at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:11082:1)
    at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:11082:1)
    at injectInjectorOnly (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:801:1)
    at ɵɵinject (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:805:1)
    at Object.AngularFirestore_Factory [as factory] (http://localhost:9876/_karma_webpack_/node_modules/@angular/fire/__ivy_ngcc__/fesm2015/angular-fire-firestore.js:869:149)
    at R3Injector.hydrate (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:11249:1)
    at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:11071:1)
    at injectInjectorOnly (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:801:1)
    at ɵɵinject (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:805:1)
Expected undefined to be truthy.
Error: Expected undefined to be truthy.
    at &lt;Jasmine&gt;
    at UserContext.&lt;anonymous&gt; (http://localhost:9876/_karma_webpack_/src/app/shared/database/database.service.spec.ts:14:21)
    at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-evergreen.js:364:1)
</code></pre>
<p>here is my <strong>database.service.spec.ts</strong></p>
<pre><code>import { TestBed } from '@angular/core/testing';

import { DatabaseService } from './database.service';

describe('DatabaseService', () =&gt; {
  let service: DatabaseService;

  beforeEach(() =&gt; {
    TestBed.configureTestingModule({});
    service = TestBed.inject(DatabaseService);
  });

  it('should be created', () =&gt; {
    expect(service).toBeTruthy();
  });
});
</code></pre>
<p><strong>database.service.ts</strong></p>
<pre><code>import { Injectable } from '@angular/core';
// firebase
import { AngularFirestore } from '@angular/fire/firestore';
import firebase from &quot;firebase/app&quot;;
import { environment } from 'src/environments/environment.prod';

@Injectable({
  providedIn: 'root'
})
export class DatabaseService {
  public frb: any = firebase;
  public allCollections = {
    users: 'users',
  };
  constructor(
    public afs: AngularFirestore,
  ) {}
  // create
  addDocument(collection:string, docObject:any){
    return this.afs.collection(collection).add(docObject);
  }
}
</code></pre>
<p>here all angularfire module in <strong>app.module.ts</strong></p>
<pre><code>import { NgModule } from &quot;@angular/core&quot;;
import { BrowserModule } from &quot;@angular/platform-browser&quot;;
import { RouteReuseStrategy } from &quot;@angular/router&quot;;
import { PathLocationStrategy, LocationStrategy } from &quot;@angular/common&quot;;

import { IonicModule, IonicRouteStrategy } from &quot;@ionic/angular&quot;;
import { SplashScreen } from &quot;@ionic-native/splash-screen/ngx&quot;;
import { StatusBar } from &quot;@ionic-native/status-bar/ngx&quot;;

import { AppRoutingModule } from &quot;./app-routing.module&quot;;
import { AppComponent } from &quot;./app.component&quot;;

import { HttpClientModule } from &quot;@angular/common/http&quot;;
// firebase
import { AngularFireModule } from &quot;@angular/fire&quot;;
import { AngularFireAuthModule } from &quot;@angular/fire/auth&quot;;
import { AngularFireDatabaseModule } from &quot;@angular/fire/database&quot;;
import { AngularFirestoreModule } from &quot;@angular/fire/firestore&quot;;
import { AngularFirestore } from &quot;@angular/fire/firestore&quot;;
import { environment } from &quot;../environments/environment&quot;;
import { FormsModule, ReactiveFormsModule } from &quot;@angular/forms&quot;;

// ion2-calendar
import { CalendarModule } from &quot;ion2-calendar&quot;;

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    AngularFireModule.initializeApp(environment.firebaseConfig),
    AngularFireAuthModule,
    AngularFireDatabaseModule,
    AngularFirestoreModule,
    AngularFirestore,
    CalendarModule,
    HttpClientModule,
    FormsModule,
    ReactiveFormsModule,
  ],
  providers: [
    StatusBar,
    SplashScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
    { provide: LocationStrategy, useClass: PathLocationStrategy },
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}
</code></pre>
<p><strong>package.json</strong></p>
<pre><code>{
  &quot;name&quot;: &quot;****&quot;,
  &quot;version&quot;: &quot;0.0.1&quot;,
  &quot;author&quot;: &quot;Ionic Framework&quot;,
  &quot;homepage&quot;: &quot;https://ionicframework.com/&quot;,
  &quot;scripts&quot;: {
    &quot;ng&quot;: &quot;ng&quot;,
    &quot;start&quot;: &quot;ng serve&quot;,
    &quot;build&quot;: &quot;ng build&quot;,
    &quot;test&quot;: &quot;ng test&quot;,
    &quot;lint&quot;: &quot;ng lint&quot;,
    &quot;e2e&quot;: &quot;ng e2e&quot;
  },
  &quot;private&quot;: true,
  &quot;dependencies&quot;: {
    &quot;@angular/common&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/core&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/fire&quot;: &quot;^6.0.4&quot;,
    &quot;@angular/forms&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/platform-browser&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/platform-browser-dynamic&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/router&quot;: &quot;~10.0.0&quot;,
    &quot;@capacitor/android&quot;: &quot;^2.4.5&quot;,
    &quot;@capacitor/core&quot;: &quot;2.4.5&quot;,
    &quot;@codetrix-studio/capacitor-google-auth&quot;: &quot;^2.1.3&quot;,
    &quot;@ionic-native/core&quot;: &quot;^5.0.0&quot;,
    &quot;@ionic-native/splash-screen&quot;: &quot;^5.0.0&quot;,
    &quot;@ionic-native/status-bar&quot;: &quot;^5.0.0&quot;,
    &quot;@ionic/angular&quot;: &quot;^5.0.0&quot;,
    &quot;@ionic/pwa-elements&quot;: &quot;^3.0.2&quot;,
    &quot;firebase&quot;: &quot;^8.2.7&quot;,
    &quot;firebaseui&quot;: &quot;^4.7.1&quot;,
    &quot;ion2-calendar&quot;: &quot;^3.5.0&quot;,
    &quot;moment&quot;: &quot;^2.24.0&quot;,
    &quot;rxjs&quot;: &quot;~6.5.5&quot;,
    &quot;talisman&quot;: &quot;^1.1.4&quot;,
    &quot;tslib&quot;: &quot;^2.0.0&quot;,
    &quot;zone.js&quot;: &quot;~0.10.3&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;@angular-devkit/build-angular&quot;: &quot;~0.1000.0&quot;,
    &quot;@angular/cli&quot;: &quot;~10.0.5&quot;,
    &quot;@angular/compiler&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/compiler-cli&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/language-service&quot;: &quot;~10.0.0&quot;,
    &quot;@capacitor/cli&quot;: &quot;2.4.5&quot;,
    &quot;@ionic/angular-toolkit&quot;: &quot;^2.3.0&quot;,
    &quot;@types/jasmine&quot;: &quot;~3.5.0&quot;,
    &quot;@types/jasminewd2&quot;: &quot;~2.0.3&quot;,
    &quot;@types/node&quot;: &quot;^12.11.1&quot;,
    &quot;codelyzer&quot;: &quot;^6.0.0&quot;,
    &quot;jasmine-core&quot;: &quot;~3.5.0&quot;,
    &quot;jasmine-spec-reporter&quot;: &quot;~5.0.0&quot;,
    &quot;karma&quot;: &quot;~5.0.0&quot;,
    &quot;karma-chrome-launcher&quot;: &quot;~3.1.0&quot;,
    &quot;karma-coverage-istanbul-reporter&quot;: &quot;~3.0.2&quot;,
    &quot;karma-jasmine&quot;: &quot;~3.3.0&quot;,
    &quot;karma-jasmine-html-reporter&quot;: &quot;^1.5.0&quot;,
    &quot;protractor&quot;: &quot;~7.0.0&quot;,
    &quot;ts-node&quot;: &quot;~8.3.0&quot;,
    &quot;tslint&quot;: &quot;~6.1.0&quot;,
    &quot;typescript&quot;: &quot;~3.9.5&quot;
  },
  &quot;description&quot;: &quot;An Ionic project&quot;
}
</code></pre>
",https://stackoverflow.com/questions/68109920/facing-the-null-injector-error-while-trying-to-perform-end-to-end-testing-for-da,"['angular', 'firebase', 'ionic-framework']",735,True,0,1
Gitlab CI End to End testing failing because of webdriver-manager is not recognized as an internal or external command,"<p>I am working on a nodejs project that has some End to End tests. The test are running fine on my local and it failing from my gitlab pipeline because of webdriver was not recognized.</p>
<p>I tried installing webdriver in couple of different ways like Protractor but not fixed my issues. Any help would be appriciated.</p>
<p><strong>Here is my gitlab-ci.yml file</strong></p>
<p>stages:</p>
<ul>
<li>build</li>
<li>test</li>
</ul>
<p>before_script:</p>
<ul>
<li>npm install # install npm packages</li>
<li>npm install protractor -g</li>
</ul>
<p>build:</p>
<p>stage: build</p>
<p>script:</p>
<pre><code>- npm run build
</code></pre>
<p>test:</p>
<p>stage: test</p>
<p>script:</p>
<pre><code>- npm run test:e2e
</code></pre>
<p>only:</p>
<pre><code>- master
</code></pre>
<p><strong>Error from pipeline</strong></p>
<p>webdriver-manager update --ignore_ssl --gecko false
'webdriver-manager' is not recognized as an internal or external command
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myproject@0.1.0 pree2e: <code>webdriver-manager update --ignore_ssl --gecko false</code>
npm ERR! Exit status 1</p>
",https://stackoverflow.com/questions/69016967/gitlab-ci-end-to-end-testing-failing-because-of-webdriver-manager-is-not-recogni,"['node.js', 'selenium', 'npm', 'gitlab', 'gitlab-ci']",281,True,0,1
What&#39;s the best way to do end to end testing that can be run via CI pipeline when the frontend and backend are in separate repos?,"<p>I currently have an Angular frontend and a dockerized Django backend. Both are deployed separately. Angular via Netlify and Django via Heroku. Both are triggered to deploy any publishes to the master branch.</p>
<p>I've written end to end tests using Cypress and integrated it to the CI using GitHub actions. At the moment I ended up deploying a test backend server which is a replica of the production on a separate Heroku instance and am using that link as the backend for the cypress test suite that lives inside the UI repo and runs every time before pushing to master. To be more specific, whenever I need to publish changes, I push to staging and on push to staging, the CI workflow is triggered and runs the test and if the tests pass, the changes to staging get merged with master and from there changes are automatically deployed. The backend gets published to production without any prior testing.</p>
<p>There are two problems with this setup. First is that for the CI to rely on an external API is time consuming. Second thing is that for me to push changes to the API without the e2e suite running and having it only be run when corresponding UI changes get published is sort of problematic because breaking changes to the API could get published unchecked.</p>
<p>Is there a more elegant way to do this within GitHub actions? Because I find it convenient. If not, what other solution do I have to address these 2 issues?</p>
",https://stackoverflow.com/questions/70392979/whats-the-best-way-to-do-end-to-end-testing-that-can-be-run-via-ci-pipeline-whe,"['testing', 'continuous-integration', 'integration-testing']",275,False,3,0
How can I get the search button textusing PlayWright end to end testing tool,"<p>How can I get the <code>search</code> button text in <code>PlayWright</code> end to end testing tool. I have tried below and getting <code>page.innerText(selector, options)</code> but getting undefined. Can someone please advise why the innerText method is not working here.</p>
<p>//homePage.js</p>
<pre><code>const { expect } = require('@playwright/test');

exports.HomePage = class HomePage {
    constructor(page) {
        this.page = page;
        this.getSearchButton = page.innerText(.RoundButton__root .RoundButton__root--blue');
      }

      async goto() {
        await this.page.goto('https://www.localsearch.com.au/');
      }
      
      async getSearchButtonText() {
        await this.getSearchButton ;
      }
      
}
</code></pre>
<p>//home.js</p>
<pre><code>const { test, expect } = require('@playwright/test');
const { HomePage } = require('../pom/homePage');

    test('Verify Search button text', async ({ page }) =&gt; {
      const homePage = new HomePage(page);
      await homePage.goto();
      const text = await homePage.getSearchButtonText();
      console.log(&quot;Search text::&quot;+text);
     
    });
</code></pre>
",https://stackoverflow.com/questions/69832856/how-can-i-get-the-search-button-textusing-playwright-end-to-end-testing-tool,"['javascript', 'playwright']",178,False,0,0
Problems to sets the fragment from a FragmentScenario to be used from DataBindingIdlingResource,"<p>I'm following <a href=""https://developer.android.com/codelabs/advanced-android-kotlin-training-testing-survey#0"" rel=""nofollow noreferrer"">this Google Codelab</a> and at the <strong>page 8</strong> (Task: End-to-End Testing with Data Binding), at <strong>step 8</strong> (Write DataBindingIdlingResource) you have to create a file called <code>DataBindingIdlingResource.kt</code>.</p>
<pre class=""lang-kotlin prettyprint-override""><code>class DataBindingIdlingResource : IdlingResource {
    [...]
}

private fun View.getBinding(): ViewDataBinding? = DataBindingUtil.getBinding(this)

/**
 * Sets the activity from an [ActivityScenario] to be used from [DataBindingIdlingResource].
 */
fun DataBindingIdlingResource.monitorActivity(
    activityScenario: ActivityScenario&lt;out FragmentActivity&gt;
) {
    activityScenario.onActivity {
        this.activity = it
    }
}

/**
 * Sets the fragment from a [FragmentScenario] to be used from [DataBindingIdlingResource].
 */
fun DataBindingIdlingResource.monitorFragment(fragmentScenario: FragmentScenario&lt;out Fragment&gt;) {
    fragmentScenario.onFragment {
        this.activity = it.requireActivity()
    }
}
</code></pre>
<p><strong>The problem:</strong>
is the last function <code>fun DataBindingIdlingResource.monitorFragment</code> because <code>fragmentScenario.onFragment</code> provides only <code>onFragment(action: Nothing)</code> and not <code>onFragment {}</code>.</p>
<p>How Can I solve this issue?
Thanks.</p>
",https://stackoverflow.com/questions/67968209/problems-to-sets-the-fragment-from-a-fragmentscenario-to-be-used-from-databindin,"['android', 'testing', 'data-binding', 'android-espresso', 'google-codelab']",567,True,4,2
Jest has detected the following 1 open handle potentially keeping Jest from exiting: TCPSERVERWRAP,"<p>I am doing a basic end to end testing here, for the moment it's failing, but first I can't get rid of the open handle.</p>
<pre><code>Ran all test suites.

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  TCPSERVERWRAP

      40 |     }
      41 |     return request(app.getHttpServer())
    &gt; 42 |       .post('/graphql')
         |        ^
      43 |       .send(mutation)
      44 |       .expect(HttpStatus.OK)
      45 |       .expect((response) =&gt; {

      at Test.Object.&lt;anonymous&gt;.Test.serverAddress (../node_modules/supertest/lib/test.js:61:33)
      at new Test (../node_modules/supertest/lib/test.js:38:12)
      at Object.obj.&lt;computed&gt; [as post] (../node_modules/supertest/index.js:27:14)
      at Object.&lt;anonymous&gt; (app.e2e-spec.ts:42:8)
</code></pre>
<pre><code>import { Test, TestingModule } from '@nestjs/testing'
import { HttpStatus, INestApplication } from &quot;@nestjs/common&quot;;
import * as request from 'supertest'
import { AppModule } from '../src/app.module'

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

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

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

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

  it('/ (GET)', () =&gt; {
    return request(app.getHttpServer())
      .get('/')
      .expect(HttpStatus.OK)
      .expect('Hello World!')
  })

  it('mutation', async () =&gt; {
    const mutation = {
      query: `mutation Create($title: String!) {
        create(title: $title) {
          id,
          title
        }
      }`,
      variables: {
        title: 'Mon programme',
      },
    }
    return request(app.getHttpServer())
      .post('/graphql')
      .send(mutation)
      .expect(HttpStatus.OK)
      .expect( (response) =&gt; {
        expect(response.body).toBe({
          id: expect.any(String),
          title: 'Mon programme',
        })
      })
  })
})
</code></pre>
<p>Any idea what's blocking the test runner ?</p>
<p>Note that, as I am using NestJs, I shouldn't need to use the <code>.end(done)</code> method at the end of the test.</p>
<p>PS: apparently I have to much code on this question and I need to add some more details, but have no clue what I can say more.</p>
",https://stackoverflow.com/questions/68437734/jest-has-detected-the-following-1-open-handle-potentially-keeping-jest-from-exit,"['typescript', 'jestjs', 'graphql', 'nestjs', 'supertest']",45928,True,29,9
Running test using Terratest but it throws &quot;no test files&quot; error,"<p>I am working on terratest for terraform in Azure. Currently making use of an example code as given in the following link- <a href=""https://learn.microsoft.com/en-us/azure/developer/terraform/best-practices-end-to-end-testing"" rel=""nofollow noreferrer"">https://learn.microsoft.com/en-us/azure/developer/terraform/best-practices-end-to-end-testing</a>.</p>
<p>When I try to run <code>go test -v</code> it gives out [no test files], not sure why.</p>
<p>Can anyone help?</p>
",https://stackoverflow.com/questions/67733626/running-test-using-terratest-but-it-throws-no-test-files-error,"['azure', 'terraform', 'terraform-provider-azure', 'terratest']",542,False,0,1
How do I perform google authentication with Selenium?,"<p>I have read many stackoverflow responses about this, but they seem very outdated. In order to do end to end testing on my application, I need to login through google SSO which is the login method the application uses. How can I perform this task with selenium because I keep getting the following. <a href=""https://i.stack.imgur.com/Pl14P.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/Pl14P.png"" alt=""Google Rejection"" /></a></p>
",https://stackoverflow.com/questions/69414398/how-do-i-perform-google-authentication-with-selenium,"['selenium', 'selenium-webdriver', 'selenium-chromedriver']",29,False,0,0
How to test Scotty endpoints,"<p>With the following <a href=""https://hackage.haskell.org/package/scotty"" rel=""nofollow noreferrer"">Scotty</a> endpoint:</p>
<pre class=""lang-hs prettyprint-override""><code>myendpoint :: Text -&gt; ScottyM ()
myendpoint info =
    post &quot;/foo/bar/:var&quot; $ do
        var :: Text &lt;- param &quot;var&quot;
        query :: Query &lt;- jsonData
        result &lt;- liftIO $ retrieveResult info var query
        json $ result

runApi :: IO ()
runApi = scotty 4602 $ do
    myendpoint
</code></pre>
<p>How to test <code>myendpoint</code> with different possible inputs, for instance</p>
<pre class=""lang-hs prettyprint-override""><code>info1 = &quot;foo&quot;
query1 = Query { qParam1 = &quot;foo&quot;, qParam2 = &quot;bar&quot; }
var1 = &quot;bar&quot;
expect1 = Result { foo = &quot;foo&quot;, bar = &quot;bar&quot; }

res1 = decode $ test_myendpoint info1 query1 var1
res1 `shouldBe` expect1

info2 = &quot;baz&quot;
query2 = Query { qParam1 = &quot;hello&quot;, qParam2 = &quot;there&quot; }
var2 = &quot;boo&quot;
expect2 = Result { foo = &quot;biz&quot;, bar = &quot;dev&quot; }

res2 = decode $ test_myendpoint info2 query2 var2
res2 `shouldBe` expect2
</code></pre>
<p>I'm tempted to simply run the API in another thread, then query the endpoint for real with some JSON, but is there a cleaner way to do this? (although the benefit of the above would be real end-to-end testing)</p>
",https://stackoverflow.com/questions/67520834/how-to-test-scotty-endpoints,"['haskell', 'testing', 'endpoint', 'scotty']",139,True,1,1
useState hook does not update when value is set by JS,"<p>I got an input field that I fill via JS for end-to-end testing.</p>
<pre><code>document.getElementById(&quot;textfield&quot;).click()
document.getElementById(&quot;textfield&quot;).value = &quot;test&quot;
</code></pre>
<p>Unfortunately the useState hook updates only when I manually type in another character.</p>
<p>Is there a way to simulate my typing (already tried it character by character with .value) or how do I solve that issue?</p>
<p>Thanks in advance!</p>
",https://stackoverflow.com/questions/69884701/usestate-hook-does-not-update-when-value-is-set-by-js,"['javascript', 'reactjs', 'unit-testing', 'ionic-framework']",35,False,1,0
How can I add space between words when typing in Protractor?,"<p>In Protractor end to end testing, on UI - text field I am want to type word <code>Dinbert Syndrome</code> and making a check if that word was already added before.</p>
<p>The problem I am facing is <code>sendKeys(str)</code> does not identify space between <code>Dinbert Syndrome</code> and types as <code>DinbertSyndrome</code></p>
<p><strong>EXPECTED Text</strong> - <code>Dinbert Syndrome</code></p>
<p><strong>Text I get</strong> - <code>DinbertSyndrome</code></p>
<p>How can I solve this problem?</p>
<p>test.js file</p>
<pre><code>describe('check for same word', () =&gt; {
  it('should detect duplicate', () =&gt; {
    browser.get('/edit/id=21123333');
   
    click(by.xpath('/html[1]/span[2]'));
    insertTerm('Dinbert Syndrome', 0, 12);
    text('Duplicate Term detected');
  });
});
</code></pre>
<p>.js file</p>
<pre><code>exports.insertTerm = funcsecondon insertTerm(term, first, second) {
  click(by.id('insertTerm_' + first));
  exports.editField('Term', term, `//div[contains(@id, &quot;concept_${first}_term_${second}&quot;)]`); // textarea
};



exports.editField = (property, str, locasecondon = '') =&gt; {
  console.log('property', property, 'str', str, 'loacsecondon', locasecondon)
  const xPath = locasecondon + `//textarea[@placeholder=&quot;${property}&quot;]`;
  click(by.xpath(xPath));
  browser.element(by.xpath(xPath)).sendKeys(str);
};
</code></pre>
",https://stackoverflow.com/questions/68104526/how-can-i-add-space-between-words-when-typing-in-protractor,"['angular', 'selenium-webdriver', 'automated-tests', 'protractor', 'sendkeys']",190,False,0,0
End-End test and Integration test in Micronaut using Test Container,"<p>I have a Micronaut application with the following structure</p>
<ol>
<li>API Gateway (Communicate with the producer)</li>
<li>Product Producer (RabbitMq-Producer)</li>
<li>Product Consumer (RabbitMq-Consumer)</li>
</ol>
<p>Now I want to perform End-to-End and Integration testing for the application in local development and CI/CD.</p>
<p>I am using the RabbitMq Test container for the End-End and Integration testing.</p>
<p><strong>CI/CD pipeline</strong></p>
<p>After merging code and deployed the application to the server, run the integration and end-end test. Because producer and consumer will be running and all the test cases will work.</p>
<p><strong>Local Development</strong></p>
<p>Since the RabbitMQ Consumer is dependent on the Producer. While running Integration or End-to-End testing the Product producer application might not be running. So all the test case will be failed. A solution will be to run the producer application manually before running the tests.</p>
<p>Or Containerise all the applications and run the Test. What are the best practices for Integration or End-to-End testing in a microservice architecture?</p>
",https://stackoverflow.com/questions/68799663/end-end-test-and-integration-test-in-micronaut-using-test-container,"['java', 'junit', 'rabbitmq', 'microservices', 'micronaut']",943,True,1,1
Facing the null injector error while trying to perform end to end testing for data service using Jasmine,"<p><strong>Facing the null injector error while trying to perform end to end testing for data service using Jasmine.</strong></p>
<p>NullInjectorError: R3InjectorError(DynamicTestModule)[DatabaseService -&gt; AngularFirestore -&gt; InjectionToken angularfire2.app.options -&gt; InjectionToken angularfire2.app.options]:
NullInjectorError: No provider for InjectionToken angularfire2.app.options!</p>
<p>if I run 'ng test' always shows this error</p>
<pre><code>DatabaseService &gt; should be created
NullInjectorError: R3InjectorError(DynamicTestModule)[DatabaseService -&gt; AngularFirestore -&gt; InjectionToken angularfire2.app.options -&gt; InjectionToken angularfire2.app.options]: 
  NullInjectorError: No provider for InjectionToken angularfire2.app.options!
error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'DatabaseService', 'AngularFirestore', 'InjectionToken angularfire2.app.options', 'InjectionToken angularfire2.app.options' ] })
    at &lt;Jasmine&gt;
    at NullInjector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:915:1)
    at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:11082:1)
    at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:11082:1)
    at injectInjectorOnly (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:801:1)
    at ɵɵinject (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:805:1)
    at Object.AngularFirestore_Factory [as factory] (http://localhost:9876/_karma_webpack_/node_modules/@angular/fire/__ivy_ngcc__/fesm2015/angular-fire-firestore.js:869:149)
    at R3Injector.hydrate (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:11249:1)
    at R3Injector.get (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:11071:1)
    at injectInjectorOnly (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:801:1)
    at ɵɵinject (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:805:1)
Expected undefined to be truthy.
Error: Expected undefined to be truthy.
    at &lt;Jasmine&gt;
    at UserContext.&lt;anonymous&gt; (http://localhost:9876/_karma_webpack_/src/app/shared/database/database.service.spec.ts:14:21)
    at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-evergreen.js:364:1)
</code></pre>
<p>here is my <strong>database.service.spec.ts</strong></p>
<pre><code>import { TestBed } from '@angular/core/testing';

import { DatabaseService } from './database.service';

describe('DatabaseService', () =&gt; {
  let service: DatabaseService;

  beforeEach(() =&gt; {
    TestBed.configureTestingModule({});
    service = TestBed.inject(DatabaseService);
  });

  it('should be created', () =&gt; {
    expect(service).toBeTruthy();
  });
});
</code></pre>
<p><strong>database.service.ts</strong></p>
<pre><code>import { Injectable } from '@angular/core';
// firebase
import { AngularFirestore } from '@angular/fire/firestore';
import firebase from &quot;firebase/app&quot;;
import { environment } from 'src/environments/environment.prod';

@Injectable({
  providedIn: 'root'
})
export class DatabaseService {
  public frb: any = firebase;
  public allCollections = {
    users: 'users',
  };
  constructor(
    public afs: AngularFirestore,
  ) {}
  // create
  addDocument(collection:string, docObject:any){
    return this.afs.collection(collection).add(docObject);
  }
}
</code></pre>
<p>here all angularfire module in <strong>app.module.ts</strong></p>
<pre><code>import { NgModule } from &quot;@angular/core&quot;;
import { BrowserModule } from &quot;@angular/platform-browser&quot;;
import { RouteReuseStrategy } from &quot;@angular/router&quot;;
import { PathLocationStrategy, LocationStrategy } from &quot;@angular/common&quot;;

import { IonicModule, IonicRouteStrategy } from &quot;@ionic/angular&quot;;
import { SplashScreen } from &quot;@ionic-native/splash-screen/ngx&quot;;
import { StatusBar } from &quot;@ionic-native/status-bar/ngx&quot;;

import { AppRoutingModule } from &quot;./app-routing.module&quot;;
import { AppComponent } from &quot;./app.component&quot;;

import { HttpClientModule } from &quot;@angular/common/http&quot;;
// firebase
import { AngularFireModule } from &quot;@angular/fire&quot;;
import { AngularFireAuthModule } from &quot;@angular/fire/auth&quot;;
import { AngularFireDatabaseModule } from &quot;@angular/fire/database&quot;;
import { AngularFirestoreModule } from &quot;@angular/fire/firestore&quot;;
import { AngularFirestore } from &quot;@angular/fire/firestore&quot;;
import { environment } from &quot;../environments/environment&quot;;
import { FormsModule, ReactiveFormsModule } from &quot;@angular/forms&quot;;

// ion2-calendar
import { CalendarModule } from &quot;ion2-calendar&quot;;

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    AngularFireModule.initializeApp(environment.firebaseConfig),
    AngularFireAuthModule,
    AngularFireDatabaseModule,
    AngularFirestoreModule,
    AngularFirestore,
    CalendarModule,
    HttpClientModule,
    FormsModule,
    ReactiveFormsModule,
  ],
  providers: [
    StatusBar,
    SplashScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
    { provide: LocationStrategy, useClass: PathLocationStrategy },
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}
</code></pre>
<p><strong>package.json</strong></p>
<pre><code>{
  &quot;name&quot;: &quot;****&quot;,
  &quot;version&quot;: &quot;0.0.1&quot;,
  &quot;author&quot;: &quot;Ionic Framework&quot;,
  &quot;homepage&quot;: &quot;https://ionicframework.com/&quot;,
  &quot;scripts&quot;: {
    &quot;ng&quot;: &quot;ng&quot;,
    &quot;start&quot;: &quot;ng serve&quot;,
    &quot;build&quot;: &quot;ng build&quot;,
    &quot;test&quot;: &quot;ng test&quot;,
    &quot;lint&quot;: &quot;ng lint&quot;,
    &quot;e2e&quot;: &quot;ng e2e&quot;
  },
  &quot;private&quot;: true,
  &quot;dependencies&quot;: {
    &quot;@angular/common&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/core&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/fire&quot;: &quot;^6.0.4&quot;,
    &quot;@angular/forms&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/platform-browser&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/platform-browser-dynamic&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/router&quot;: &quot;~10.0.0&quot;,
    &quot;@capacitor/android&quot;: &quot;^2.4.5&quot;,
    &quot;@capacitor/core&quot;: &quot;2.4.5&quot;,
    &quot;@codetrix-studio/capacitor-google-auth&quot;: &quot;^2.1.3&quot;,
    &quot;@ionic-native/core&quot;: &quot;^5.0.0&quot;,
    &quot;@ionic-native/splash-screen&quot;: &quot;^5.0.0&quot;,
    &quot;@ionic-native/status-bar&quot;: &quot;^5.0.0&quot;,
    &quot;@ionic/angular&quot;: &quot;^5.0.0&quot;,
    &quot;@ionic/pwa-elements&quot;: &quot;^3.0.2&quot;,
    &quot;firebase&quot;: &quot;^8.2.7&quot;,
    &quot;firebaseui&quot;: &quot;^4.7.1&quot;,
    &quot;ion2-calendar&quot;: &quot;^3.5.0&quot;,
    &quot;moment&quot;: &quot;^2.24.0&quot;,
    &quot;rxjs&quot;: &quot;~6.5.5&quot;,
    &quot;talisman&quot;: &quot;^1.1.4&quot;,
    &quot;tslib&quot;: &quot;^2.0.0&quot;,
    &quot;zone.js&quot;: &quot;~0.10.3&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;@angular-devkit/build-angular&quot;: &quot;~0.1000.0&quot;,
    &quot;@angular/cli&quot;: &quot;~10.0.5&quot;,
    &quot;@angular/compiler&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/compiler-cli&quot;: &quot;~10.0.0&quot;,
    &quot;@angular/language-service&quot;: &quot;~10.0.0&quot;,
    &quot;@capacitor/cli&quot;: &quot;2.4.5&quot;,
    &quot;@ionic/angular-toolkit&quot;: &quot;^2.3.0&quot;,
    &quot;@types/jasmine&quot;: &quot;~3.5.0&quot;,
    &quot;@types/jasminewd2&quot;: &quot;~2.0.3&quot;,
    &quot;@types/node&quot;: &quot;^12.11.1&quot;,
    &quot;codelyzer&quot;: &quot;^6.0.0&quot;,
    &quot;jasmine-core&quot;: &quot;~3.5.0&quot;,
    &quot;jasmine-spec-reporter&quot;: &quot;~5.0.0&quot;,
    &quot;karma&quot;: &quot;~5.0.0&quot;,
    &quot;karma-chrome-launcher&quot;: &quot;~3.1.0&quot;,
    &quot;karma-coverage-istanbul-reporter&quot;: &quot;~3.0.2&quot;,
    &quot;karma-jasmine&quot;: &quot;~3.3.0&quot;,
    &quot;karma-jasmine-html-reporter&quot;: &quot;^1.5.0&quot;,
    &quot;protractor&quot;: &quot;~7.0.0&quot;,
    &quot;ts-node&quot;: &quot;~8.3.0&quot;,
    &quot;tslint&quot;: &quot;~6.1.0&quot;,
    &quot;typescript&quot;: &quot;~3.9.5&quot;
  },
  &quot;description&quot;: &quot;An Ionic project&quot;
}
</code></pre>
",https://stackoverflow.com/questions/68109920/facing-the-null-injector-error-while-trying-to-perform-end-to-end-testing-for-da,"['angular', 'firebase', 'ionic-framework']",735,True,0,1
How do I write unit tests in Cypress? Is that even possible?,"<p>I am using Cypress with Cucumber to develope a front-end with vue.js using behaviour driven development (BDD). I can already use Cypress for end-to-end testing, but I was also required to create and run unit tests. I could not find anything on the official Cypress website. How can I create and run unit tests for this front-end?</p>
",https://stackoverflow.com/questions/70072966/how-do-i-write-unit-tests-in-cypress-is-that-even-possible,"['javascript', 'html', 'vue.js', 'unit-testing', 'cypress']",2203,True,0,1
Ignore SSL errors with playwright code generation,"<p>I am using the jest-playwright library (<a href=""https://github.com/playwright-community/jest-playwright"" rel=""noreferrer"">https://github.com/playwright-community/jest-playwright</a>) to perform end-to-end testing. In the jest.config.js file you can set an option to ignore SSL errors:</p>
<pre><code>contextOptions: {
   ignoreHTTPSErrors: true,
}
</code></pre>
<p>This works fine when running the tests with jest.<br />
Now, I would want playwright to generate the code when clicking on website elements with the command <code>npx playwright codegen example.com</code>. However, playwright stops because of the SSL error when opening the website.<br />
<br />
Is there an option to ignore SSL errors when using playwright code generation?</p>
",https://stackoverflow.com/questions/67048422/ignore-ssl-errors-with-playwright-code-generation,"['ssl', 'jestjs', 'code-generation', 'end-to-end', 'playwright']",17322,True,11,3
nestjs integration test &quot;Cannot set property &quot;userId&#39; of undefined&quot;,"<p>I am starting to write end-to-end testing in nestjs. even the first simple test failed.</p>
<pre><code>describe('Authentication system', () =&gt; {
  let app: INestApplication;

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

  it('/(POST)', () =&gt; {
    const email = 'khfkjdhsf@hot';
    return request(app.getHttpServer())
      .post('/signup')
      .send({ email, password: 'kasdhfkjdhfkj' })
      .expect(201)
      .then((res) =&gt; {
        const { id, email } = res.body;
        expect(id).toBeDefined();
      });
  });
});
</code></pre>
<p>this is controller:</p>
<pre><code>@Post('/signup')
  async createUser(@Body() body: CreateUserDto, @Session() session: any) {
    const user = await this.authService.signUp(body.email, body.password);
    session.userId = user.id;
    return user;
  }
</code></pre>
<p>this is authService.signup:</p>
<pre><code>async signUp(email: string, password: string) {
    const users = await this.usersService.find(email);
    if (users.length) {
      throw new BadRequestException('Email in use');
    }

    const salt = randomBytes(16).toString('hex');
    const hash = (await scrypt(password, salt, 64)) as Buffer;
    const result = salt + '.' + hash.toString('hex');

    const user = await this.usersService.create(email, result);
    return user;
  }
</code></pre>
<p>I am using cookie-session for authentication in bootstrap():</p>
<pre><code> app.use(
    cookieSession({
      keys: ['anything'],
      }),
   );
</code></pre>
<p>when I send post request to <code>/signup</code> everything works fine. I believe testing logic is correct. I could not find answer on stackoverflow.</p>
<p>I also get this error under above error: &quot;Expected 201, 500 Internal Server Error&quot;</p>
",https://stackoverflow.com/questions/68946405/nestjs-integration-test-cannot-set-property-userid-of-undefined,"['node.js', 'typescript', 'jestjs', 'nestjs', 'integration-testing']",1097,True,0,2
"How do I use Jest to test the output in one element, from an input from another element?","<p>My test is trying to mock a user typing &quot;abcdef&quot; in the textarea as an input, and then verify if the same string (&quot;abcdef&quot;) is written in the output:</p>
<pre><code>it(&quot;should write in input and correspond in output&quot;, async () =&gt; {
    render(App);

    const input = document.getElementById(&quot;input&quot;);
    fireEvent.change(input, { target: { value: 'abcdef' }})
    
    let output = document.getElementById(&quot;output&quot;);
    expect(output).toHaveTextContent(&quot;abcdef&quot;); // undefined
});
</code></pre>
<p>This is the output element:</p>
<pre><code>    &lt;h1 id=&quot;output&quot;&gt;{output}&lt;/h1&gt;
</code></pre>
<p>If I hardcode 'abcdef' next to the {output} tag, then my test passes, but the <em>fireEvent.change</em> doesn't seem to work properly. Maybe I misunderstand the capabilities of Jest - maybe it only does unit testing, and not user-tests /end-to-end testing?</p>
",https://stackoverflow.com/questions/69241760/how-do-i-use-jest-to-test-the-output-in-one-element-from-an-input-from-another,"['jestjs', 'svelte']",380,True,0,1
Understanding JobLauncherTestUtils,"<p>I am currently getting to understand <code>jobLauncherTestUtils</code>. I have read about it from multiple resources such as following:
<a href=""https://docs.spring.io/spring-batch/docs/current/api/org/springframework/batch/test/JobLauncherTestUtils.html"" rel=""nofollow noreferrer"">https://docs.spring.io/spring-batch/docs/current/api/org/springframework/batch/test/JobLauncherTestUtils.html</a></p>
<p><a href=""https://livebook.manning.com/concept/spring/joblaunchertestutils"" rel=""nofollow noreferrer"">https://livebook.manning.com/concept/spring/joblaunchertestutils</a></p>
<p>I wanted to understand when we call <code>jobLauncherTestUtils.launchJob()</code>, what does it mean by end-to-end testing of job. Does it actually launch the job. If so, then what's the point of testing the job without mocks? If not so, then how does it actually tests a job?</p>
",https://stackoverflow.com/questions/66535431/understanding-joblaunchertestutils,['spring-batch'],974,True,0,1
Playwright force click on hidden element does not work,"<p>I am using Playwright for end to end testing. One of the scenario involves checking the content of a pdf displayed in a PDFviewer window, for which download button have been hidden for the end user. Checking the pdf content involves downloading it, thus I used
the <code>force</code> option mentionned by Playwright documentation :
<a href=""https://playwright.dev/docs/api/class-page#page-click"" rel=""nofollow noreferrer"">https://playwright.dev/docs/api/class-page#page-click</a></p>
<p>The implementation used is the following :</p>
<pre class=""lang-js prettyprint-override""><code>innerFrameContent.click(&quot;//button[contains(@id, 'secondaryDownload')]&quot;, { force: true })
</code></pre>
<p>(the xpath is correct, I checked within Chrome browser and managed to click on the element through the console )</p>
<p>Unfortunatly, I get the following exception log from Playwright :</p>
<pre><code>frame.click: Element is not visible
=========================== logs ===========================
waiting for selector &quot;//button[contains(@id, 'secondaryDownload')]&quot;
  selector resolved to hidden &lt;button tabindex=&quot;54&quot; title=&quot;Download&quot; id=&quot;secondaryDown…&gt;…&lt;/button&gt;
attempting click action
  waiting for element to be visible, enabled and stable
    forcing action
  element is visible, enabled and stable
  scrolling into view if needed
============================================================
...
</code></pre>
",https://stackoverflow.com/questions/70124342/playwright-force-click-on-hidden-element-does-not-work,"['javascript', 'node.js', 'playwright']",11354,True,2,1
How to get cypress.io to swipe ionic ion-item-sliding to the left?,"<p>I have a small ionic 4 (vue) app with an <code>ion-list</code> which includes <code>ion-item-sliding</code>:
here is how the code looks</p>
<p><strong>HTML</strong></p>
<pre><code>&lt;ion-item-sliding v-for=&quot;day in month.days&quot; v-bind:key=&quot;day.day&quot;&gt;
    &lt;ion-item
      :id=&quot;'times-item-'+day.day+'-'+month.name.toLowerCase()+'-'+month.year&quot;
      @click=&quot;openAddEditModal(day)&quot;
    &gt;
      &lt;ion-grid&gt;
        &lt;ion-row&gt;
          &lt;ion-col size=&quot;4&quot;&gt;
            &lt;ion-label :color=&quot;switchLabelColor(day)&quot;&gt;
              &lt;div id=&quot;times-item-day-weekday&quot;&gt;{{ day.weekday }}.&lt;/div&gt;
              &lt;div id=&quot;times-item-day-day&quot; class=&quot;bigger&quot;&gt;
                {{ day.day }}
              &lt;/div&gt;
            &lt;/ion-label&gt;
          &lt;/ion-col&gt;

          &lt;ion-col size=&quot;4&quot; v-if=&quot;getDayEntry(day)&quot;&gt;
            &lt;ion-text
              id=&quot;times-item-start-end-time&quot;
              v-if=&quot;isWork(getDayEntry(day).type)&quot;
            &gt;
              {{ formatTime(getDayEntry(day).start) }} -
              {{ formatTime(getDayEntry(day).end) }}
            &lt;/ion-text&gt;
          &lt;/ion-col&gt;

          &lt;ion-col
            id=&quot;times-item-stats&quot;
            size=&quot;4&quot;
            class=&quot;ion-text-end&quot;
            v-if=&quot;getDayEntry(day)&quot;
          &gt;
            {{ formatDuration(getDayEntry(day).worktime) }}&lt;br /&gt;
            &lt;ion-text
              id=&quot;times-item-overtime&quot;
              :color=&quot;switchOvertimeColor(getDayEntry(day).overtime)&quot;
              &gt;{{ getDayEntry(day).overtime.toString() }}&lt;/ion-text
            &gt;
          &lt;/ion-col&gt;
        &lt;/ion-row&gt;
      &lt;/ion-grid&gt;
    &lt;/ion-item&gt;
    &lt;ion-item-options side=&quot;end&quot;&gt;
      &lt;ion-item-option
        id=&quot;times-item-delete-button&quot;
        v-if=&quot;day.entry&quot;
        ion-item-option
        color=&quot;danger&quot;
        expandable
        @click=&quot;deleteEntryForDay(day)&quot;
        &gt;Delete&lt;/ion-item-option
      &gt;
    &lt;/ion-item-options&gt;
  &lt;/ion-item-sliding&gt;
</code></pre>
<p>I'm doing end-to-end testing of the app with <code>cypress.io</code> but I can't get cypress to swipe the <code>ion-item-sliding</code> to the left side.</p>
<p>I tried it on the <code>ion-item-sliding</code> and also on the <code>ion-item</code> with various mouse events such as down, move, up, pointer. I also tried with touch event but nothing worked.</p>
<p>The last thing I tried was this test script:</p>
<p><code>test typescript</code></p>
<pre><code>it(&quot;Delete today entry&quot;, () =&gt; {
    //GIVEN
    const today = new Date();
    const todayString: string = createItemSelectorTextForDate(today);

    //WHEN
    cy.get(&quot;#times-item-&quot;+todayString)
    .trigger('mousedown', {force: true})
    .trigger('mousemove', {clientX: -80, force: true})
    .trigger('mouseup', {force: true});
})
</code></pre>
<p>Does Someone know how to get <code>cypress.io</code> to work with Ionic components```</p>
",https://stackoverflow.com/questions/67660002/how-to-get-cypress-io-to-swipe-ionic-ion-item-sliding-to-the-left,"['typescript', 'vue.js', 'ionic-framework', 'ionic4', 'cypress']",1190,True,2,1
fail gitlab multijob pipeline if test job fails in another repository,"<p>I have a gitlab ci pipeline in my application repo, A, which calls an end to end testing Repo T to run its tests. The repo A pipeline succesfully triggers the tests from Repo T but if the test job fails in T, the job calling the test job in T from A still passes. How do I get repo A to track the result of Repo T's test job, and pass/fail its pipeline based off of the test jobs in T?</p>
<p>.gitlab-ci.yml for testing Repo T:</p>
<pre><code>stages:
  - test

test:
  stage: test
  image: markhobson/maven-chrome:jdk-11
  artifacts:
    paths:
      - target/surefire-reports
  script:
    - mvn test
  only:
    - triggers
</code></pre>
<p>.gitlab-ci.yml from application repo A:</p>
<pre><code>job1:
    stage: unit-tests ...
job2:
    stage: build ...
...

trigger-e2e-repo:
  stage: e2e-testing
  image: markhobson/maven-chrome
  script:
    - &quot;curl -X POST -F token=repo-T-token -F ref=repo-T-branch https://repo-A/api/v4/projects/repo-T-id/trigger/pipeline&quot;
  only:
    - repo-A-branch
</code></pre>
",https://stackoverflow.com/questions/66909047/fail-gitlab-multijob-pipeline-if-test-job-fails-in-another-repository,"['gitlab', 'gitlab-ci']",1451,True,1,2
Getting attributes values and comparing the values from other attributes (values have line break in HTML) UseCase: Price comparison,"<p>I am a big fan of Karate and exploring Karate UI for the end-to-end testing but stuck on one simple thing which is finding element by attribute where value has a line break in HTML and assertion always fails.</p>
<p>When I use
And match attribute('#eg01SubmitId', 'type') == 'submit'
And match text('.myClass') == 'Class Locator Test'</p>
<p>Use case: Comparing Prices (Getting price quotes from elements in one application and comparing it with price quotes in other applications)
<a href=""https://i.stack.imgur.com/UBBqS.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/UBBqS.png"" alt=""enter image description here"" /></a></p>
<p>Like Car deals quotes
<a href=""https://i.stack.imgur.com/obiGP.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/obiGP.png"" alt=""enter image description here"" /></a></p>
<p><a href=""https://i.stack.imgur.com/hrbYf.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/hrbYf.png"" alt=""enter image description here"" /></a></p>
<p>What is the best strategy in this use case and how I can implement this in Karate?</p>
",https://stackoverflow.com/questions/69772407/getting-attributes-values-and-comparing-the-values-from-other-attributes-values,['karate'],204,True,2,1
NestJS E2E tests with Jest. Injected service returns undefined (only tests),"<p>I have a problem with the end-to-end testing of my users module. I want to validate if there is a &quot;companyCode&quot; when a user makes a GET request in /users and sends this code in the query params. This validator searches the database if this company code exists, if it does not exist it returns an error. The problem is that in the test this validation doesn't happen, because &quot;companiesService&quot; returns undefined (only in the test), what's missing?</p>
<p>Possible Solution: something related to <strong>useContainer(class-validator)</strong>.</p>
<p>Thanks.</p>
<hr />
<p><strong>users.e2e-spec.ts</strong></p>
<pre><code>describe('UsersController (e2e)', () =&gt; {
  let app: INestApplication;
  let repository: Repository&lt;User&gt;;

  beforeAll(async () =&gt; {
    const module = await Test.createTestingModule({
      imports: [UsersModule, AuthModule, TypeOrmModule.forRoot(ormConfig)],
      providers: [
        {
          provide: APP_GUARD,
          useClass: AuthGuard,
        },
      ],
    }).compile();

    app = module.createNestApplication();
    app.useGlobalPipes(new ValidationPipe());
    useContainer(app.select(UsersModule), { fallbackOnErrors: true });

    repository = module.get('UserRepository');
    await app.init();
  });

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

  describe('/users (GET)', () =&gt; {
    it('should return users if requesting user sent &quot;companyCode&quot; in the request body', async (done) =&gt; {
      return request(app.getHttpServer())
        .get('/users')
        .auth('admin', 'admin')
        .query({ companyCode: '2322661870558778503' }) // should return 200 because companyCode exists but is returning 400
        .expect(200)
        .then((res) =&gt; {
          expect(res.body.users).toHaveLength(1);
          done();
        })
        .catch((err) =&gt; done(err));
    });
  });
});
</code></pre>
<hr />
<p><strong>users.module.ts</strong></p>
<pre><code>@Module({
  controllers: [UsersController],
  providers: [UsersService, UserExistsRule],
  imports: [
    TypeOrmModule.forFeature([
      User,
      Person,
      Type,
      Profile,
      UserProfile,
      Company,
    ]),
    CompaniesModule,
  ],
  exports: [UsersService],
})
export class UsersModule {}
</code></pre>
<hr />
<p><strong>read-users.dto.ts</strong></p>
<pre><code>export class ReadUsersDto {
  @IsOptional()
  @IsNotEmpty()
  @IsString()
  @MinLength(1)
  @MaxLength(255)
  public name?: string;

  @IsOptional()
  @IsNotEmpty()
  @IsNumberString()
  @Type(() =&gt; String)
  @Validate(CompanyExistsRule)
  public companyCode?: string;
}
</code></pre>
<hr />
<p><strong>companies.module.ts</strong></p>
<pre><code>@Module({
  providers: [CompaniesService, CompanyExistsRule],
  imports: [TypeOrmModule.forFeature([Company, Person])],
  exports: [CompaniesService],
})
export class CompaniesModule {}
</code></pre>
<hr />
<p><strong>companies.decorator.ts</strong></p>
<pre><code>@ValidatorConstraint({ name: 'CompanyExists', async: true })
@Injectable()
export class CompanyExistsRule implements ValidatorConstraintInterface {
  constructor(private companiesService: CompaniesService) {}

  async validate(code: string) {
    try {
      console.log('companiesService', this.companiesService); // returns undefined on test
      await this.companiesService.findOneByCode(code);
    } catch (e) {
      return false;
    }

    return true;
  }

  defaultMessage() {
    return `companyCode doesn't exist`;
  }
}
</code></pre>
",https://stackoverflow.com/questions/68383000/nestjs-e2e-tests-with-jest-injected-service-returns-undefined-only-tests,"['dependency-injection', 'jestjs', 'nestjs', 'e2e-testing', 'class-validator']",1009,False,0,1
Mocking APIs in End to End Testing with Detox and React-Native,"<p>Has anyone been able to mock APIs in React-Native when doing end to end testing with Detox.</p>
<p>I tried using MirageJs. I am able to mock the APIs after creating a server with MirageJs and initializing it on App.js. The request is successfully mocked when running the app as normal &quot;react-native run-ios&quot;</p>
<p>However when running the e2e.js file, the API request is not being mocked. In the test file I included the following</p>
<pre><code>let server
beforeEach(() =&gt; {
    server = makeServer()
})

afterEach(() =&gt; {
    server.shutdown()
})
</code></pre>
<p>And the server seems to be created. But the API is not mocked.</p>
<p>Happy to hear from anyone who has been able to mock APIs in detox test using MirageJS or a different approach</p>
",https://stackoverflow.com/questions/68302530/mocking-apis-in-end-to-end-testing-with-detox-and-react-native,"['javascript', 'react-native', 'automated-tests', 'detox', 'miragejs']",457,False,2,0
Testing authentication with Auth0 in a full stack application with Cypress,"<p>I’m working on a full-stack NestJS application, integrating with Auth0 using the <a href=""https://github.com/auth0/express-openid-connect"" rel=""nofollow noreferrer"">express-openid-connect library</a>. I’m using Cypress for e2e tests, and I’m trying to find a way of testing my login using Cypress.</p>
<p>I found this article - <a href=""https://auth0.com/blog/end-to-end-testing-with-cypress-and-auth0/"" rel=""nofollow noreferrer"">https://auth0.com/blog/end-to-end-testing-with-cypress-and-auth0/</a>, but it seems to be very much tied to a React application. I’m calling the /oauth/token API endpoint, and I get a response, but I’m unsure how to build out my callback URL to log me in to the application. Here’s what I have so far:</p>
<pre><code>Cypress.Commands.add('login', () =&gt; {
  cy.session('logged in user', () =&gt; {
    const options = {
      method: 'POST',
      url: `${Cypress.env('OAUTH_DOMAIN')}/oauth/token`,
      body: {
        grant_type: 'password',
        username: Cypress.env('AUTH_USERNAME'),
        password: Cypress.env('AUTH_PASSWORD'),
        scope: 'openid profile email',
        audience: `${Cypress.env('OAUTH_DOMAIN')}/api/v2/`,
        client_id: Cypress.env('OAUTH_CLIENT_ID'),
        client_secret: Cypress.env('OAUTH_CLIENT_SECRET'),
      },
    };
    cy.request(options).then((response) =&gt; {
      // What do I do here?
    });
  });
});
</code></pre>
<p>Any pointers would be gratefully recieved!</p>
",https://stackoverflow.com/questions/70115205/testing-authentication-with-auth0-in-a-full-stack-application-with-cypress,"['testing', 'oauth', 'nestjs', 'cypress', 'auth0']",1133,True,1,1
Test containers not deleted from docker after JUnit 5 all class tests completed,"<p>I am using the test container for integration testing and end-to-end testing of the micronaut application.</p>
<p>Here is the configuration for the test container</p>
<pre><code>@Testcontainers
public abstract class TestContainerFixture {
    protected static final GenericContainer mongoDBContainer;
    protected static final Map&lt;String, Object&gt; properties;

    static {
        mongoDBContainer = new GenericContainer(DockerImageName.parse(&quot;mongo:4.0.10&quot;))
                .withExposedPorts(27017)
                .withReuse(true);
        mongoDBContainer.start();
        properties = Map.of(&quot;mongodb.uri&quot;,
                String.format(&quot;mongodb://%s:%s&quot;, mongoDBContainer.getContainerIpAddress(), mongoDBContainer.getMappedPort(27017)));
    }

    protected ApplicationContext applicationContext;
}
</code></pre>
<p>A class extending the test container</p>
<pre><code>public class DiscountUpdateListenerTest extends TestContainerFixture {
}
</code></pre>
<p>Since I am using <code>.withReuse(true);</code> to reuse the test container for all the other test class. If I disable the <code>.withReuse(false)</code> on each class when the integration test is running, the container is created which takes the longer time for the test to execute.</p>
<p>So, to reuse the same container I have used the feature <code>.withReuse(true)</code>. Since the container remain there for longer period of time. So I want to remove the container on each 1-2 hours</p>
",https://stackoverflow.com/questions/68907354/test-containers-not-deleted-from-docker-after-junit-5-all-class-tests-completed,"['java', 'junit', 'micronaut', 'testcontainers', 'testcontainers-junit5']",2230,True,1,1
Pytest BDD - select stubbed or live API calls,"<p>I'm working on developing some Behavior Driven Development i.e style tests using pytest-bdd.  We want to re-use the same features and more or less the same step definitions to having  both stubbed and live calls to a third party API i.e. we want to reuse test code for integration and end to end testing.</p>
<p>I'm wondering about whether there was a convention on how to handle alternating between mocked and real calls in pytest_bdd or pytest</p>
<p>This question is similar: <a href=""https://stackoverflow.com/questions/50678020/running-pytest-tests-against-multiple-backends"">Running pytest tests against multiple backends?</a> with an answer to add a parser option with a <code>pytest_addoption</code> hook placed in the top level <code>conftest.py</code>.</p>
",https://stackoverflow.com/questions/67272691/pytest-bdd-select-stubbed-or-live-api-calls,"['testing', 'pytest', 'integration-testing', 'pytest-mock', 'pytest-bdd']",231,False,0,1
Select in H2 but with database prefix,"<p>At work, I had an assignment to query data from multiple MSSQL databases that sit on the same host machine, with just one query. It works fine, looks like something like this:</p>
<pre><code>SELECT
    user.name as userName,
    product.name as productName
FROM
    userDb.dbo.userTable user 
    INNER JOIN productDb.dbo.productTable product on user.id = product.buyer
WHERE user.id = ?
</code></pre>
<p>However, when I wanted to extend the end-to-end testing solution that uses a mock H2 database, I realized that H2 doesn't support databases like that. The query fails with &quot;Schema productDb not found&quot;. While productDb should be the database, the schema is dbo and the table is productTable.</p>
<p>Is there a way to circumvent this in H2, or I'll need to do two separate calls to the separate databases, then merge the results together, just for testing?</p>
",https://stackoverflow.com/questions/67600370/select-in-h2-but-with-database-prefix,['h2'],172,True,0,1
Testing NestJS Validation Pipe not working,"<p>I have a simple class I am trying to get to work with NestJS and End To End testing to ensure I can get the validations working properly, but I cannot get the validations to work.  If I send the data with Postman, or a normal client, the application does respond with the proper error.</p>
<p>API.dto.ts</p>
<pre><code>import { IsNumber, IsPositive, IsString } from 'class-validator';
export class ApiDTO {
    @IsString() public readonly FileName:string;
    @IsNumber() @IsPositive() public readonly StatusCode:number;
    @IsNumber() @IsPositive() public readonly TimeOut:number;
}
</code></pre>
<p>E2E Test File</p>
<pre><code>import { Test, TestingModule } from '@nestjs/testing';
import * as request from 'supertest';

import { INestApplication, ValidationPipe } from '@nestjs/common';

import { AppModule } from '@APP/app.module';
import { ApiDTO } from './../../src/api/api.dto';

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

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

        app = moduleFixture.createNestApplication();
        app.useGlobalPipes(new ValidationPipe());
        await app.init();
    });

    it('/api/test/ (POST) test to see data validation works', async done =&gt; {
        const RequestBody:ApiDTO = {
            FileName : 'README.md',
            StatusCode: 111,
            TimeOut: -25
        };
        const Expected:string = `${RequestBody.FileName} = ${RequestBody.StatusCode.toString()} after ${RequestBody.TimeOut.toString()}`;

        const ResponseData = await request(app.getHttpServer())
            .post('/api/test')
            .send(RequestBody)
            .set('Accept', 'application/json');

        // All of these will fail as the code returns a 200 OK, as it does not do the validation (TimeOut -25 should fail IsPositive())
        expect(ResponseData.status).toBe(400);
        expect(ResponseData.headers['content-type']).toContain('application/json');

        // This line caused the problem as body is an object
        //expect(ResponseData.body.length).toBeGreaterThan(2);

        expect(ResponseData.body.statusCode).toBe(400);
        expect(ResponseData.body.message[0]).toBe('TimeOut must be a positive number');
        expect(ResponseData.body.error).toBe('Bad Request');
        done();         
    });

});
</code></pre>
<p>I get a successful return, 200, when making this call.  My code should be failing, due to the TimeOut with a negative number, where it needs to be <code>IsPositive()</code>. The service and other code all runs, just not the validations. I have added the global pipes in the beforeEach() so not sure what else to check.</p>
",https://stackoverflow.com/questions/66680945/testing-nestjs-validation-pipe-not-working,"['jestjs', 'automated-tests', 'nestjs']",4936,True,3,2
Clone depth on AWS Pipeline,"<p>I am trying to send git repo metadata along to the cypress dashboard for end to end testing. This testing is triggered with AWS CodePipeline.</p>
<p>According to Amazon's documentation <a href=""https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-github-gitclone.html"" rel=""nofollow noreferrer"">here</a> one should be able to select the clone depth while setting up the CodePipeline. Though when I am at that stage in the tutorial there is no option as only repository and branch are listed.</p>
<p>The batch build uses the source from the pipeline when the pipeline is triggered (manually or by webhook) but no git repo metadata is received.</p>
<p>In the CodeBuild used in the pipeline the clone depth option is set to full. When the CodeBuild is triggered manually the metadata is available and sent to Cypress dashboard.</p>
<p>Is it something simple I am missing?</p>
",https://stackoverflow.com/questions/68453251/clone-depth-on-aws-pipeline,"['git', 'amazon-web-services', 'cypress', 'aws-codepipeline']",1607,True,1,1
How to run service with deploy.replica=0 in docker-compose.yml?,"<p>I have services in my <code>docker-compose.yml</code> configuration that I would occasionally use, such as for end-to-end testing, linting, or some one-off service.</p>
<p>Something along the lines of this:</p>
<pre><code>  app:
    ...

  e2e-or-linter-or-one-off:
    ...
    deploy:
      replicas: 0
</code></pre>
<p>With <code>replicas</code> set to 0, <code>docker-compose up</code> would not spin up the <code>e2e-or-linter-or-one-off</code> service when I just want to run my regular app container(s).</p>
<p>And when I would need that <code>e2e-or-linter-or-one-off</code> service, I want to do something like this:</p>
<pre><code>docker-compose run e2e-or-linter-or-one-off bash
</code></pre>
<p>Is there a way to define a service that doesn't spin up on <code>docker-compose up</code> but is still able to be used with <code>docker-compose run</code>?</p>
<p><code>docker-compose up</code> has a <code>--scale</code> flag that I can use if I wanted to spin everything up, such as:</p>
<pre><code>docker-compose up --scale &quot;e2e-or-linter-or-one-off&quot;=1 e2e-or-linter-or-one-off
</code></pre>
<p>But <code>docker-compose run</code> doesn't have a similar flag that can be used and I need <code>docker-compose run</code> so I can run the container interactively.  Without it this:</p>
<pre><code>docker-compose run e2e bash
</code></pre>
<p>won't work and Docker returns: <code>no containers to start</code></p>
<p>Thank you for your help 🙏</p>
",https://stackoverflow.com/questions/70093583/how-to-run-service-with-deploy-replica-0-in-docker-compose-yml,"['docker', 'docker-compose', 'containers']",889,True,2,1
pytest: Run test modules in a specific order,"<p>Let me say I'm still new to unit testing and using <code>pytest</code>.</p>
<p>I'm building unit tests and running them with GitHub Actions and I understand why it failed. I need to run the test modules in a specific order.</p>
<p>For reference, I have a following repo structure (generalized for simplicity)</p>
<pre><code>mypackage/
├── __init__.py
├── foo.py
└── bar.py
tests/
├── __init__.py
├── test_foo.py
└── test_bar.py
</code></pre>
<p>My question (written for generalization): Is there a way to run specific test modules (not functions) in a given order with <code>pytest</code>? By default <code>pytest</code> will run in alphabetical order, i.e., <code>test_bar</code> before <code>test_foo</code>. However, in my case, <code>test_bar</code> uses data from <code>test_foo</code>, so I would like the order to be flipped. I can find other work arounds, but from my search I only found explanations of using <code>pytest-order</code> or <code>pytest-ordering</code> for specific functional orders in a <em>given</em> module. I thought this would be a good question for end-to-end testing while still ensuring 100% code coverage.</p>
<p>Thanks.</p>
",https://stackoverflow.com/questions/66307767/pytest-run-test-modules-in-a-specific-order,"['python', 'python-3.x', 'pytest', 'github-actions']",729,False,2,0
How to run dockerized protractor project which included Angular?,"<p>I'm new to the protractor. I created a project with angular and its works fine without docker. However, when I build the image it's successfully created. Unfortunately unable to run that one.</p>
<p>Folder : <strong>protractor</strong> Contents below</p>
<pre><code>.
./Dockerfile
./protractor.sh
./protractor.conf.js
./package-lock.json
./node_modules
./package.json
./specs
</code></pre>
<p>I've run it manually using this command</p>
<pre><code>protractor$ ./protractor.sh protractor.conf.js
</code></pre>
<p>Then results as follows</p>
<pre><code>[14:36:13] I/launcher - Running 1 instances of WebDriver
[14:36:13] I/local - Starting selenium standalone server...
[14:36:14] I/local - Selenium standalone server started at http://192.168.8.103:53238/wd/hub
[14:36:14] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.gecko.driver=/usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.29.1 -Dwebdriver.chrome.driver=/usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_90.0.4430.24 -jar /usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar -port 4444
[14:36:14] I/start - seleniumProcess.pid: 14964
14:36:14.643 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
14:36:14.710 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2021-05-23 14:36:14.744:INFO::main: Logging initialized @260ms to org.seleniumhq.jetty9.util.log.StdErrLog
14:36:14.951 INFO [WebDriverServlet.&lt;init&gt;] - Initialising WebDriverServlet
14:36:15.069 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
Started
[14:36:20] W/element - more than one element found for locator By(css selector, .ng-binding) - the first result will be used
.


1 spec, 0 failures
Finished in 7.482 seconds

[14:36:22] I/local - Shutting down selenium standalone server.
[14:36:22] I/launcher - 0 instance(s) of WebDriver still running
[14:36:22] I/launcher - chrome #01 passed
</code></pre>
<p>Docker build command as per below</p>
<pre><code>sudo docker build -t priyanwso2/protractor-docker .
Sending build context to Docker daemon   36.5MB
Step 1/8 : FROM         node:latest
 ---&gt; 7493e35c7ffa
Step 2/8 : WORKDIR  /tmp
 ---&gt; Using cache
 ---&gt; d1941bcedacd
Step 3/8 : RUN      apt-get update --fix-missing &amp;&amp;         apt-get install -y xvfb wget openjdk-11-jre-headless libgconf-2-4 libexif12 chromium &amp;&amp;         apt-get clean
 ---&gt; Using cache
 ---&gt; 0f440f61b0f9
Step 4/8 : RUN      mkdir /protractor &amp;&amp;            npm install -g protractor
 ---&gt; Using cache
 ---&gt; eca289196866
Step 5/8 : RUN      webdriver-manager update
 ---&gt; Using cache
 ---&gt; fa2d0cc0ca06
Step 6/8 : ADD      protractor.sh /protractor.sh
 ---&gt; Using cache
 ---&gt; 83ef2046c6b0
Step 7/8 : WORKDIR  /protractor
 ---&gt; Using cache
 ---&gt; 0f7bb601e197
Step 8/8 : ENTRYPOINT   [&quot;/protractor.sh&quot;]
 ---&gt; Using cache
 ---&gt; a25c6c8f566b
Successfully built a25c6c8f566b
Successfully tagged priyanwso2/protractor-docker:latest
</code></pre>
<p>When I run the docker images, it listed in docker images list</p>
<pre><code>priyanwso2/protractor-docker   latest    a25c6c8f566b   47 minutes ago   1.69GB
</code></pre>
<p>When I try to run the docker image it will give below error</p>
<pre><code>sudo docker run priyanwso2/protractor-docker protractor.conf.js
[09:09:57] E/configParser - Error code: 105
[09:09:57] E/configParser - Error message: failed loading configuration file protractor.conf.js
[09:09:57] E/configParser - Error: Cannot find module '/protractor/protractor.conf.js'
Require stack:
- /usr/local/lib/node_modules/protractor/built/configParser.js
- /usr/local/lib/node_modules/protractor/built/launcher.js
- /usr/local/lib/node_modules/protractor/built/cli.js
- /usr/local/lib/node_modules/protractor/bin/protractor
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
    at Function.Module._load (node:internal/modules/cjs/loader:774:27)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at ConfigParser.addFileConfig (/usr/local/lib/node_modules/protractor/built/configParser.js:135:26)
    at Object.initFn [as init] (/usr/local/lib/node_modules/protractor/built/launcher.js:93:22)
    at Object.&lt;anonymous&gt; (/usr/local/lib/node_modules/protractor/built/cli.js:227:10)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
</code></pre>
<p>OS Ubuntu 18.04 LTS (64bit)</p>
<p>Dockerfile</p>
<pre><code>FROM            node:latest

WORKDIR         /tmp

RUN             apt-get update --fix-missing &amp;&amp; \
                apt-get install -y xvfb wget openjdk-11-jre-headless libgconf-2-4 libexif12 chromium &amp;&amp; \
                apt-get clean

RUN             mkdir /protractor &amp;&amp; \
                npm install -g protractor

RUN             webdriver-manager update

ADD             protractor.sh /protractor.sh

WORKDIR         /protractor

ENTRYPOINT      [&quot;/protractor.sh&quot;]
</code></pre>
<p>package.json file as per below</p>
<pre><code>{
  &quot;name&quot;: &quot;test&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;Test e2e package&quot;,
  &quot;main&quot;: &quot;conf.js&quot;,
  &quot;dependencies&quot;: {
    &quot;chromedriver&quot;: &quot;^90.0.1&quot;,
    &quot;jasmine&quot;: &quot;^3.7.0&quot;,
    &quot;protractor&quot;: &quot;^7.0.0&quot;,
    &quot;webdriver-manager&quot;: &quot;^12.1.8&quot;
  },
  &quot;scripts&quot;: {
    &quot;test&quot;: &quot;protractor.conf.js&quot;
  },
  &quot;author&quot;: &quot;SOAS&quot;,
  &quot;license&quot;: &quot;ISC&quot;
}
</code></pre>
<p>protractor.conf.js as per below</p>
<pre><code>exports.config = {
  multiCapabilities: [{browserName: 'chrome'}],
  specs: ['specs/superCalculatorTest.js' ],
  onPrepare: function(){browser.ignoreSynchronization = true;},
};
</code></pre>
<p>See here for code in protractor.sh</p>
<pre><code>#!/bin/bash
webdriver-manager start &amp;
protractor $@
</code></pre>
<p>under the specs folder one js (superCalculatorTest.js) is exists. here is the code of it</p>
<pre><code>const { $, browser } = require(&quot;protractor&quot;);
let url = 'https://juliemr.github.io/protractor-demo/';

describe('Super Calculator Test suite', () =&gt; {
    it('Verify Adding two Integers', () =&gt; {
        browser.get(url);
        browser.sleep(2000);
        element(by.model('first')).sendKeys(2);
        element(by.model('second')).sendKeys(5);
        element(by.id('gobutton')).click();
        browser.sleep(2000);
        expect(element(by.className('ng-binding')).getText()).toEqual('7');
        browser.sleep(2000);
    });
});
</code></pre>
<p>Please help to sortout this issue. I use this medium page to write testing part.
<a href=""https://bytes.grubhub.com/end-to-end-testing-with-docker-71008dca11a0"" rel=""nofollow noreferrer"">https://bytes.grubhub.com/end-to-end-testing-with-docker-71008dca11a0</a></p>
",https://stackoverflow.com/questions/67658099/how-to-run-dockerized-protractor-project-which-included-angular,"['angular', 'docker', 'selenium', 'npm', 'protractor']",220,True,0,1
angular e2e test waits unnecessarily,"<p>I'm trying to write end-to-end tests. I'm using <a href=""https://js.cytoscape.org/"" rel=""nofollow noreferrer"">cytoscape.js</a> and angular 11. <a href=""https://js.cytoscape.org/"" rel=""nofollow noreferrer"">Cytoscape.js</a> constantly renders a canvas to make graph visualization. So change detection is always triggered. To eliminate that I'm using the <a href=""https://angular.io/api/core/NgZone#runOutsideAngular"" rel=""nofollow noreferrer"">runOutsideAngular</a> method of <code>ngZone</code> like below</p>
<pre><code>this.ngZone.runOutsideAngular(() =&gt; {
  this._g.cy = cytoscape({
    container: containerElem,
    zoom: 1,
  });
});
</code></pre>
<p>So with this way change detection is not fired constantly.</p>
<p>I'm also checking the detected changes in my main angular component with the below code.</p>
<pre><code>ngAfterViewChecked(): void {
  console.log('change detected!');
}
</code></pre>
<p>My problem is with end-to-end testing. In tests even if there aren't any changes (I'm opening the developer console and checking) and the website looks idle, I see that the test still waits for something. It WAITS LIKE 5-6 seconds. This makes all my tests take too much time.</p>
<p>I'm suspecting from <a href=""http://www.protractortest.org/#/api?view=ProtractorBrowser.prototype.waitForAngular"" rel=""nofollow noreferrer"">waitForAngular</a>. But since there are not changes, it shouldn't be the reason.</p>
<p>Any ideas? Thank you</p>
",https://stackoverflow.com/questions/65773943/angular-e2e-test-waits-unnecessarily,"['angular', 'protractor', 'angular11']",55,False,0,0
Run docker images in a docker application separately from test method,"<p>I have a docker app which has two containers. One is MySql and the other is some logic code which I have created a custom image of using a Dockerfile. For end to end testing, I wish to store some values in the database and then run the logic code image (Logic in golang). This is the docker-compose file I have currently:</p>
<pre><code>version: '3'
networks:
  docker-network:
    driver: bridge
services:
    database:
        image: mysql
        env_file:
          - ./src/logic/environment-variables.env
        ports:
          - 3306:3306
        healthcheck:
          test: &quot;mysql -uroot -p$$MYSQL_ROOT_PASSWORD $$MYSQL_DATABASE -e 'select 1'&quot;
          timeout: 20s
          retries: 10
        network:
          docker-network
    logic:
        container_name: main-logic
        build: ./src/logic/.
        depends_on:
          database:
            condition: service_healthy
        network:
          docker-network
</code></pre>
<p>I cannot run this app as a whole as that would run the main as soon as the db is running. Instead, I want to start the db, store some values in it, then run the logic image. How can I do this in a test method?</p>
<p>Approaches considered:
Start up the mysql image separately from the test method and then store values in it.Then start the logic image and check the database for results. Is there a better way or a framework to use for this?</p>
",https://stackoverflow.com/questions/70444149/run-docker-images-in-a-docker-application-separately-from-test-method,"['docker', 'go']",324,False,0,3
Server/client test isolation and initialization in TestCafe,"<p>So I'm currently developing a client/server application in Typescript/NodeJS and I want to add end-to-end testing. However, the documentation of TestCafe (and other e2e frameworks btw.) leave me clueless on what I want to achieve.</p>
<p>What I want to do is some sort of isolation of client/server setups for different tests.
I imagine something like this:</p>
<ul>
<li>Set up server environment (e.g. add certain test data, specific for the current test)</li>
<li>Set up the client (again, with a test-specific environment)</li>
<li>Run the test</li>
<li>Clean everything up</li>
<li>Rince and repeat with the next test</li>
</ul>
<p>As far as I understand the documentation, any examples assume the same server environment for all tests. Is anything like the above possible with TestCafe (without implementing too much of this functionality by myself)? Are there other frameworks that are better suited for this kind of tests?</p>
<p>Thanks for your help</p>
",https://stackoverflow.com/questions/67637899/server-client-test-isolation-and-initialization-in-testcafe,"['testing', 'automation', 'automated-tests', 'e2e-testing', 'testcafe']",124,True,0,1
Cypress can&#39;t see rails server output from within the same docker container,"<p>I'm attempting to get cypress working with rails in a single docker container. I'm using the Simplest possible Rails 6 + docker-compose project (at <a href=""https://github.com/bdavidxyz/simplest-rails-docker"" rel=""nofollow noreferrer"">https://github.com/bdavidxyz/simplest-rails-docker</a>), with cypress/included:3.8.1 (at <a href=""https://github.com/cypress-io/cypress-docker-images/tree/master/included"" rel=""nofollow noreferrer"">https://github.com/cypress-io/cypress-docker-images/tree/master/included</a>), based on the End-to-End Testing Web Apps: The Painless Way blog (at <a href=""https://mtlynch.io/painless-web-app-testing/"" rel=""nofollow noreferrer"">https://mtlynch.io/painless-web-app-testing/</a>).</p>
<p>After building, I run docker-compose up and cypress tries to start. Then the rails server starts, cypress succeeds and tests run.</p>
<p>Cypress baseurl http://web-srv:3000/ gets 403
&quot;landing&quot; <a href=""http://host.docker.internal:3000/"" rel=""nofollow noreferrer"">http://host.docker.internal:3000/</a> ECONNREFUSED 192.168.65.2:3000
google <a href=""https://google.com"" rel=""nofollow noreferrer"">https://google.com</a> works
localhost http://localhost:3000/hello/say_hello ECONNREFUSED 127.0.0.1:3000
---but I do see the rails welcome on a browser at localhost:3000.</p>
<p>Does anyone know a way to get Cypress to see the Rails output?</p>
<p>For clarity, I made a gitub repository with code and steps to reproduce: <a href=""https://github.com/Sambalero/docker-cypress-rails"" rel=""nofollow noreferrer"">https://github.com/Sambalero/docker-cypress-rails</a> (I'm on windows 10)</p>
<p>Thank you!</p>
",https://stackoverflow.com/questions/66466416/cypress-cant-see-rails-server-output-from-within-the-same-docker-container,"['ruby-on-rails', 'docker', 'docker-compose', 'cypress']",168,False,1,0
Implement Spring JMSTemplate without acknowledgement,"<p>We have a requirement is to build spring boot command line applicarion where we have to send messages to queue.</p>
<p>Only request queue has been setup.
As there is no response queue setup, we are not getting any acknowledgement from client side if they receive a message or not.
Right now I am using Spring's JMSTemplate <code>send()</code> method to send message to request queue and SingleConnectionFactory to create one shared connection as this is commmand line application</p>
<p>As there is no acknowledgement/response to message we send to request queue, End to end testing is difficult.
If destination/request queue connection is obtained and message is sent without any exception, I consider it a successful test.</p>
<p>Is it a right to implement Spring JMS templates send() method only ? and not following jms template send/receive pattern</p>
<p>Note: It is not possible to setup a response queue and get any acknowledgement from client side.</p>
",https://stackoverflow.com/questions/67263677/implement-spring-jmstemplate-without-acknowledgement,"['message-queue', 'spring-jms']",444,True,1,1
What is a good way to to mock and spy on an API dependency in Node testing?,"<p>I have a question about how best to do end-to-end/integration testing without having to mock an entire API. I've not found any great solutions and I'm starting to wonder if I'm thinking about this the wrong way.</p>
<h1>My situation</h1>
<p>I have a web client that I want to test which relies heavily on a REST API that is part of our larger system. For the most part, testing against an instance of the real API service seems like the right thing to do in our end-to-end testing scenario, but in some cases (e.g. provoking errors, empty lists et c) it would be easier to mock portions of the API than to go in and change the actual state of the API service.</p>
<p>In other cases, I don't need to mock the API, but I do need to confirm that requests were made as expected, essentially a spy, but on an API.</p>
<h1>My idea for a solution</h1>
<p>I imagined the best way to solve this would be an HTTP proxy controlled by the test suite, sitting between the system-under-test and the API service. The test suite would then:</p>
<ul>
<li>Configure the system-under-test to use the API proxy</li>
<li>For each test
<ul>
<li>Set up mocks only on relevant endpoints (the rest are proxied to the API service)</li>
<li>Exercise the system-under-test</li>
<li>Make assertions by reading spies from the proxy</li>
<li>Tear down/reset the mocks and spies afterwards</li>
</ul>
</li>
</ul>
<p>I have multiple use cases for this, one being <a href=""https://cypress.io"" rel=""nofollow noreferrer"">Cypress</a> end-to-end testing inside a browser, where monkeypatching or dependency injection is not possible, because significant portions of the system under test is not executed directly by the test-suite.</p>
<p>I found <a href=""https://www.mock-server.com/"" rel=""nofollow noreferrer"">MockServer</a> which seems to solve what I'm looking to achieve, but in a massive Java program that adds a lot of requirements (e.g. Java, which translates to CI costs) to an otherwise node-based environment.</p>
<p>EDIT: This image from MockServer illustrates one usage which matches my scenario:</p>
<p><a href=""https://www.mock-server.com/images/system_under_test_with_mockserver_proxy.png"" rel=""nofollow noreferrer""><img src=""https://www.mock-server.com/images/system_under_test_with_mockserver_proxy.png"" alt=""enter image description here"" /></a></p>
<h1>My question(s)</h1>
<p>Is what I'm considering a good approach to this type of situation? What is a good way (e.g. existing software) to solve this within the Node eco-system?</p>
",https://stackoverflow.com/questions/66829764/what-is-a-good-way-to-to-mock-and-spy-on-an-api-dependency-in-node-testing,"['node.js', 'testing', 'integration-testing', 'e2e-testing']",145,False,1,0
Testing a NestJS Service that uses Prisma without actually accessing the database,"<p>Most examples I've seen of how to test a Prisma-injected NestJS Service (e.g. <a href=""https://github.com/jmcdo29/testing-nestjs/blob/master/apps/prisma-sample/test/cats.e2e-spec.ts"" rel=""noreferrer""><code>prisma-sample</code></a> in <a href=""https://github.com/jmcdo29/testing-nestjs"" rel=""noreferrer""><code>testing-nestjs</code></a>) are for &quot;end to end&quot; testing. They actually access the database, performing actual queries and then rolling back the results if necessary.</p>
<p>For my current needs, I want to implement lower-level &quot;integration&quot; testing.</p>
<p>As part of this, I want to remove Prisma from the equation. I want the focus to be on my service's functionality instead of the state of data within the database and Prisma's ability to return it.</p>
<p>One big win of this approach is that it obviates the need to craft &quot;setup&quot; queries and &quot;teardown&quot;/reset operations for specific tests. Instead, I'd like to simply manually specify what we would expect Prisma to return.</p>
<p>In an environment consisting of NestJS, Prisma, and Jest, how should I accomplish this?</p>
<hr />
<p>UPDATE: The author of the testing-nestjs project pointed out in the comments that the project does have <a href=""https://github.com/jmcdo29/testing-nestjs/blob/master/apps/prisma-sample/src/cat/cat.service.spec.ts"" rel=""noreferrer"">an example of database mocking</a>. It looks nice! Others may still be interested in checking out the Gist that I've linked to as it includes some other useful functionality.</p>
",https://stackoverflow.com/questions/70228893/testing-a-nestjs-service-that-uses-prisma-without-actually-accessing-the-databas,"['jestjs', 'nestjs', 'prisma']",11319,True,11,3
Flutter Web - how to test flutter web application opens in Chrome on desktop?,"<p>There is a button on a web page that makes an API call to third party application. And in return third-party application gets rendered on a web page.</p>
<p>Now, the third-party application (<a href=""https://goknow.me/#/"" rel=""nofollow noreferrer"">https://goknow.me/#/</a>) is developed in <code>flutter</code> and I know nothing about <code>flutter</code>. I'm using <code>java</code>, <code>selenium</code> and <code>webdriver</code> for end to end testing. I'm using same set of tools for the rest of the application and it's working fine.</p>
<p>While inspecting in <code>chrome</code>, the DOM look like this:<a href=""https://i.stack.imgur.com/61DDo.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/61DDo.png"" alt=""flutter elements"" /></a></p>
<p>Flutter application has a form and I want to find an element so that I can send inputs during testing automation. By searching online I found this <a href=""https://github.com/appium-userland/appium-flutter-driver/tree/master/example/java"" rel=""nofollow noreferrer"">appium-flutter-driver</a>. I've also included the required <code>jar</code> in my project. With selenium webdriver I'm not able to find an element in flutter application that renders in Chrome browser on desktop.</p>
<p>Here's the code:</p>
<pre><code>import pro.truongsinh.appium_flutter.FlutterFinder;
import pro.truongsinh.appium_flutter.finder.FlutterElement;

protected FlutterFinder find;

WebElement iframe = driver.findElement(By.xpath(&quot;//iframe[@id='know-iframe']&quot;));
driver.switchTo().frame(iframe);

    find = new FlutterFinder(driver);
    FlutterElement elm = find.text(&quot;Email&quot;);
    elm.click();
    elm.sendKeys(&quot;hello world&quot;);
</code></pre>
<p>During testing automation I want to select fields in <code>form</code> and send inputs to those fields.</p>
<p><strong>How to find an element in <code>flutter</code> web application that renders in another web application in Chrome browser on desktop?</strong></p>
",https://stackoverflow.com/questions/69321923/flutter-web-how-to-test-flutter-web-application-opens-in-chrome-on-desktop,"['flutter', 'selenium', 'webdriver', 'flutter-web']",4059,False,1,3
Best practice for integration testing in React Redux app?,"<p>I'm trying to set up tests for a React-Redux application. Most resources including <a href=""https://redux.js.org/usage/writing-tests"" rel=""nofollow noreferrer"">Redux Docs</a>, and <a href=""https://kentcdodds.com/blog/testing-implementation-details"" rel=""nofollow noreferrer"">the main contributor to react-testing-library</a> argues for a focus on integration tests and that the Redux code as far as possible should be considered an implementation detail. That's cool and all, but I'm struggling to do this in practice.</p>
<p>Most examples I've found on integration testing sets up a component where you can observe the effect in the immediate unit. But several places in my app, I have components that send dispatches to my store which causes a re-render in another part of the app. To illustrate my question, I've made a simplified component tree below where I want to click the <code>AddToListButton</code> to cause <code>Element1</code> to be added to the <code>List</code>.</p>
<p>If Redux is an implementation detail, how do I actually test that clicking the button causes the update without rendering (more or less) the whole app? I understand how to do unit-testing and end-to-end testing, but not sure how I would implement integration testing.</p>
<pre><code>&lt;App&gt;
  &lt;Search&gt;
    &lt;SearchResult&gt;
      &lt;Element1&gt;
        &lt;AddToListButton /&gt; //I WANT TO TEST THIS BUTTON
      &lt;/Element1&gt;
      &lt;Element2&gt;
        &lt;AddToListButton /&gt;
      &lt;/Element2&gt; 
    &lt;/SearchResult&gt;
  &lt;/Search&gt;
  &lt;List&gt;
    &lt;Element1 /&gt; // WHEN THE BUTTON IS PRESSED THE ELEMENT SHOULD GO HERE
  &lt;/List&gt;
&lt;/App&gt;

</code></pre>
",https://stackoverflow.com/questions/68939827/best-practice-for-integration-testing-in-react-redux-app,"['reactjs', 'redux', 'react-testing-library']",128,True,0,1
How To Query Through &lt;slot&gt; Using Cypress While Testing Web Components,"<p>After years of testing one global DOM for end-to-end testing, I'm finding it very difficult, if not impossible, to test web components that use slots. Before I explain the problem, I want to say that I cannot change the generated markup to improve things as they are.</p>
<pre><code>&lt;wc-1 attributes-etc=&quot;&quot;&gt;
  &lt;wc-2 attributes-etc=&quot;&quot;&gt;
    &lt;slot&gt;
      &lt;wc-3 attributes-etc=&quot;&quot;&gt;
        &lt;slot&gt;
       ...eventually get to an input...
         &lt;input type=&quot;text&quot; name=&quot;firstName&quot; /&gt;
</code></pre>
<p>There are a buttload of nested web components from some kind of form builder, and there are also plenty of slots used. The web components have attributes but the slots never do, so I use the web component name for querying.</p>
<pre><code>document.querSelector('wc-1')
  .shadowRoot.querySelector('wc-2')
  .shadowRoot.querySelector('slot')

// Yields &lt;slot&gt;...&lt;/slot&gt;
</code></pre>
<p>All fine to this point and Cypress has a <code>.shadow()</code> command I used, but I'm testing with just devtools here to see all the properties the slot has.</p>
<pre><code>document.querSelector('wc-1')
  .shadowRoot.querySelector('wc-2')
  .shadowRoot.querySelector('slot')
  .shadowRoot

// Yields &quot;null&quot;.
// I don't know how to get to the .lightDOM? of wc-2?
</code></pre>
<p>Any property I try ends up being null or having 0 elements in the returned value. Using other front-end tools and the global DOM, I can always <code>cy.get('div[data-testid=&quot;the-nested-element-i-want&quot;]').type('important words')</code> in one command.</p>
<p>So my main question is: How do people test these things once web components start piling up? Or don't do this and just test the web components in isolation/unit tests since it's so hard to query the nested shadow DOMs?</p>
<p>The main goal is to eventually get to a form input to <code>cy.get('input[name&quot;firstName&quot;]').type('John')</code>. Can someone give me the chained <code>docuement.querySelector()</code> command to get to <code>&lt;wc-3&gt;</code> in my example?</p>
",https://stackoverflow.com/questions/66174625/how-to-query-through-slot-using-cypress-while-testing-web-components,"['cypress', 'web-component']",1294,True,1,2
Front End Unit Tests in Deno Break when DOM is involved. TS2304 [ERROR]: Cannot find name &#39;HTMLElement&#39;,"<p>I'm new to Typescript and Deno (mostly code in JS and Python) and I'm playing with writing front end typecscipt with Deno. I'm trying to use a compositional style I saw in this <a href=""https://hashnode.com/post/rusty-composition-in-typescript-cjo8g6y6b004hlxs1sabgzuzd"" rel=""nofollow noreferrer"">artlicle</a>. One of my interfaces has an HTMLElement type in it like this:</p>
<pre><code>export default interface HasElement {
  readonly element: HTMLElement;
}
</code></pre>
<p>The classes that implement this interface compile, and I can run resulting code in my browser, but if I attempt to run any unit tests using <code>deno test</code> I get an error <code>error: TS2304 [ERROR]: Cannot find name 'HTMLElement'</code></p>
<p>I've heard that the DOM is not completely implemented in Deno so I guess I'll probably need to rely on mocking or dependency injection to test any code that makes use of this interface.</p>
<p>I know that most testing involving the DOM should be done with end-to-end testing with something like Selenium, but it almost seems inevitable that some of my front end unit tests are going to run the problem of HTMLElements not existing within Deno.</p>
<p>Does anyone have any experience with this issue? What kind of solution should I look into?</p>
<p>EDIT: Here's my tsconfig.json.</p>
<pre><code>{
    &quot;compilerOptions&quot;: {
        &quot;lib&quot;: [ &quot;dom&quot;, &quot;deno.ns&quot; ]
    }
}
</code></pre>
<p>Here's the tests that are failing:
(I found this deno-dom-wasm library, but I'm not sure if its applicable to what I'm trying to do.)</p>
<pre><code>import {
  DOMParser,
  Element,
} from &quot;https://deno.land/x/deno_dom/deno-dom-wasm.ts&quot;;

import FakeBase from &quot;./components/FakeBase/FakeBase.ts&quot;;
import LoginOrganism from &quot;./organisms/LoginOrganism/LoginOrganism.ts&quot;;
import App from &quot;./App.ts&quot;;

Deno.test({
  name: &quot;test App attaches to app div&quot;,
  fn: async () =&gt; {
    const html = await Deno.readTextFile(&quot;./src/index.html&quot;);
    const doc = new DOMParser().parseFromString(
      html,
      &quot;text/html&quot;,
    )!;
    const appDiv = doc.getElementById(&quot;App&quot;) as Element;
    const fakeBase = new FakeBase(appDiv);

    const app = new App(fakeBase);
    const appElement = app.base.element;

    assertEquals(appDiv, appElement);
  },
});

Deno.test({
  name: &quot;test Apps first child is LoginOrganism&quot;,
  fn: async () =&gt; {
    const html = await Deno.readTextFile(&quot;./src/index.html&quot;);
    const doc = new DOMParser().parseFromString(
      html,
      &quot;text/html&quot;,
    )!;
    const appDiv = doc.getElementById(&quot;App&quot;) as Element;
    const fakeBase = new FakeBase(appDiv);

    const app = new App(fakeBase);

    const first_child = app.children[0] as LoginOrganism;

    assert(
      first_child instanceof LoginOrganism,
      `FIRST CHILD IS ${typeof first_child}`,
    );
  },
});

</code></pre>
",https://stackoverflow.com/questions/67828974/front-end-unit-tests-in-deno-break-when-dom-is-involved-ts2304-error-cannot,"['typescript', 'unit-testing', 'dom', 'deno']",464,False,0,2
"Cypress, page content and variables","<p>Right or wrong: In Cypress, its impossible to read a value on page X, then keep this value and compare it to a value on page Y.</p>
<p>I can read a value from the page and log it:</p>
<pre><code>cy.get('[data-e2e-selector=whatever]').then(elm =&gt; cy.log('Value from page X : ' + elm))
</code></pre>
<p>or, for instance, the number of elements with similar or partially matchin selectors:</p>
<pre><code>cy.get('[data-e2e-selector=^whatever]').then(elm =&gt; cy.log('Number of elements like this on page X: ' + elm.length))
</code></pre>
<p>Hoever, I cannot create a variable of this, because of the asynchronous way Cypress runs. Right? Any value created to just be blank.</p>
<p>Nor can I pass the value read to a method, which in turn compares it to the value on the next page:</p>
<pre><code>compareToValueOnNextPage(cy.get('[data-e2e-selector=^whatever]').then(elm =&gt; elm.length));

compareToValueOnNextPage(value: number) { // NB: Not sure if it's a number or string yet...
    cy.get('[data-e2e-selector=^whateverNextPage]').then(elm =&gt; elm.length).should('have.length', 4)
}
</code></pre>
<p>Basically, if I want to compare values, the either have to be on the same page, or they need to be hard-coded. This is a huge limitation when actually end-to-end testing some applications. Very often, a value is created on page X, based on input which should in many cases ba random, thus creating a dynamic value in the test. Then, on page Y, that same value is fetch (from the backend) or shown in some other way, in a Summary etc. And, naturally, I want to compare the value shown on page X to the one shown on page Y/Summary. But this is not possible, due to the very unit-testing thinking that seems to be the foundation for Cypress.</p>
<p>Or am I missing something here? Are there ways around this that aren't ugly/smelly? I <em>think</em> it's possible to store the value on page X in a file, then read that file on page Y. However, Cypress seems to only have <em>one</em> option when reading the file, and that's reading the whole file and looking for a match. So that file would be a mess. Or I'd need several files.</p>
<p>I realize this is kind of trying to impose non-functional ways on a quite functional and asynchroeous technology. However, if it's not possible to &quot;keep&quot; a value and use it later, it's <em>very</em> limiting when it comes to end-to-end testing (even though it's not when the testing is unit-based on frontend components).</p>
<p>UPDATE:</p>
<p>As per Kerrry's suggestion in the answer below:</p>
<pre><code>cy.get('[data-e2e-selector=dellan-accordion]')
  .then(elm =&gt; cy.wrap(elm.length).as(&quot;myVariableName&quot;));

-GO TO NEXT PAGE-

cy.get('[data-e2e-selector=betalingsplan-dellan]')
  .then(elm =&gt; elm.length)
  .should('have.length', myVariableName)
</code></pre>
<p>This yeilds &quot;expected 4 to have property 'length'.</p>
<p>This means, obviously, that I cannot get the length of the length.</p>
<p>So I replace 'have.length' with 'eq':</p>
<pre><code>cy.get('[data-e2e-selector=betalingsplan-dellan]')
  .then(elm =&gt; elm.length)
  .should('have.length', myVariableName)
</code></pre>
<p>And I get the following error:</p>
<pre><code>expected 4 to equal 0
</code></pre>
<p>So, it seems that the first variable - myVariable - is gone after the first cy.get().</p>
<p>If I do everything inside one get (have another get inside that, where I go to the next page AND get the count of the elements), then it works. But the way Kerry shows it, it would be much more flexible. But, alas, the above error.</p>
",https://stackoverflow.com/questions/67805197/cypress-page-content-and-variables,"['asynchronous', 'cypress', 'end-to-end']",541,True,-1,1
React Native with TypeScript and cucumber-js: Importing TypeScript Functions into Cucumber Step Definitions,"<p>As the title states, I'm looking to test some functions we use in a React Native app. Indeed, in the future I would like to write business functions <em>based</em> on our cucumber tests - so ideally my dev workflow would begin with me creating a test in our code base and wrestling with it until it meets all tests. However, I'm running into a problem that whenever I import said functions from our codebase, cucumber breaks and the tests don't run. So far, using <code>detox</code> for end-to-end testing has worked fine (interacting with elements via <code>TestID</code> and so on), but in a recent set of tests, I was trying to call a function explicitly, and this is where we start to run into errors.</p>
<p>We allow for cucumber tests in TypeScript by writing the following in our <code>cucumber.js</code> file:</p>
<pre class=""lang-js prettyprint-override""><code>let common = [
   'features/**/*.feature',                // Specify our feature files
   '--require-module ts-node/register',    // Load TypeScript module
   '--require features/support/**/*.ts',   // Load support files
   '--require step_definitions/**/*.ts',   // Load step definitions
].join(' ');

module.exports = {
  default: common,
};
</code></pre>
<p>However, in my <code>step_definitions</code>, as soon as I try and import a function from our React Native project, I start getting errors like this one, for example from <code>react-native</code>:</p>
<pre><code>/Users/file/path/to/project/here/node_modules/react-native/index.js:14
import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:984:16)
    at Module._compile (internal/modules/cjs/loader.js:1032:27)
    at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Object.require.extensions.&lt;computed&gt; [as .js] (/Users/file/path/to/project/here/node_modules/ts-node/src/index.ts:1300:43)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.&lt;anonymous&gt; (/Users/file/path/to/project/here/src/helpers/utils.ts:2:1)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Module.m._compile (/Users/file/path/to/project/here/node_modules/ts-node/src/index.ts:1310:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Object.require.extensions.&lt;computed&gt; [as .ts] (/Users/file/path/to/project/here/node_modules/ts-node/src/index.ts:1313:12)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Module.require (internal/modules/cjs/loader.js:957:19)
codepath: /Users/file/path/to/project/here/step_definitions/5-Chat/2-1-chat-deletion-indicator.steps.ts
</code></pre>
<p>I see here that the commonjs (<code>cjs</code>) module is firing the error. I understand that React Native is written for ES6, so commonjs is wrong in the first place. What I <em>don't</em> know how to do is keep my fancy <code>cucumber.js</code> setup file and the ability to keep my tests (and imported functions) in TypeScript without <code>ts-node</code> complaining.</p>
<p>Any assistance, pointers, or ideas here would be greatly appreciated. I'll be glad to include any other configs and files needed.</p>
",https://stackoverflow.com/questions/69440578/react-native-with-typescript-and-cucumber-js-importing-typescript-functions-int,"['typescript', 'react-native', 'cucumber', 'commonjs', 'ts-node']",1028,True,1,2
NestJS createTestingModule and getHttpServer() error 503,"<p>I'm using NestJS 7.6.0 and I'm experiencing a problem with E2E testing.</p>
<p>I have a very simple module that exposes a /health route in its controller. I'd like to test this route using the E2E testing feature of nestJs documented here:</p>
<p><a href=""https://docs.nestjs.com/fundamentals/testing#end-to-end-testing"" rel=""nofollow noreferrer"">https://docs.nestjs.com/fundamentals/testing#end-to-end-testing</a></p>
<p>I'm currently using the quite same code:</p>
<pre class=""lang-js prettyprint-override""><code>
describe('AppController (e2e)', () =&gt; {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

</code></pre>
<p>And if you run tests with <code>npm run test</code>, it shows the 503 error linked above. To make it work, I need to add <code>await app.listen(3000);</code> in the beforeAll() method right after the init() (cf. above).</p>
<p>I think my problem comes from &quot;terminus&quot; because if I start a new NestJS project which does not use Terminus, e2e testing works fine, without the need to add the .listen().</p>
<p>Do I need to do something special in the createTestingModule() with TerminusModule?</p>
<p>Thank you</p>
",https://stackoverflow.com/questions/68164554/nestjs-createtestingmodule-and-gethttpserver-error-503,"['unit-testing', 'nestjs', 'e2e-testing']",1640,False,4,0
How can I access redirect url from keycloak inside Docker container with cy.Visit()?,"<p><strong>State:</strong></p>
<p>I've got an application, that is built with <strong>Angular</strong> (as Front-End) and <strong>Quarkus</strong> as (Back-End).
The application first redirects the user to KeyCloak, and redirects back to the application (does not matter if online or localhosted) after a successful login.</p>
<p>For CI/CD I use <strong>Drone CI</strong>. Drone builds the applications first and runs the application in the container, but instead of localhost it has a customized url, lets call it app-url.</p>
<p>For End-To-End Testing I use <strong>Cypress</strong>. The test I want to do is a login test. There are no other npm packages, only cypress and newman in this project. Locally the test can be executed successfully, it makes 2 requests, 1 for authentification and 1 for getting the redirect url which is needed to access the content inside the application.</p>
<p>Here is the test in code that works on localhost:</p>
<pre><code>describe('simple login test', () =&gt; {
    beforeEach(() =&gt; {
        cy.clearCookies();
        cy.clearLocalStorage();

    });

    it('login', () =&gt; {

        cy.log('login start')

        function createUUID() {
            const s = [];
            const hexDigits = '0123456789abcdef';

            for (let i = 0; i &lt; 36; i++) {
                s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
            }

            s[14] = '4';
            s[19] = hexDigits.substr((parseInt(s[19]) &amp; 0x3) | 0x8, 1);
            s[8] = s[13] = s[18] = s[23] = '-';

            return s.join('');
        }

        cy.request({
            url: '{keycloak-url}',
            qs: {
                client_id: '{clientid}',
                redirect_uri: 'http://localhost:8360',
                scope: 'openid',
                state: createUUID(),
                nonce: createUUID(),
                response_type: 'code',
                response_mode: 'fragment',
            }
        })
        .then((response) =&gt; {
            cy.log('login first request')

            const _el = document.createElement('html');
            _el.innerHTML = response.body;

            const loginForm = _el.getElementsByTagName('form');
            const isAlreadyLoggedIn = !loginForm.length;
            if (isAlreadyLoggedIn) {
                return;
            }

            cy.wait(1000)
            cy.request({
                form: true,
                method: 'POST',
                url: loginForm[0].action,
                followRedirect: false,
                body: {
                    username: &quot;user&quot;,
                    password: &quot;pwd&quot;
                }
            })
                .then((res) =&gt; {
                    cy.log('login second request')
                    cy.log(res);
                    cy.wait(1000)
                    cy.log(&quot;RedirectToUrl ist &quot; + res.redirectedToUrl)
                    cy.visit(res.redirectedToUrl);
                    cy.log('Login Redirect complete')
                })
          })
     });
})
</code></pre>
<p><strong>Error:</strong></p>
<p>The error is with the redirect uri. Cypress does make an attempt to command a visit but everytime, the redirect cannot be accessed with Cy.Visit().</p>
<pre><code>https://app-url:8360/

We attempted to make an http request to this URL but the request failed without a response.

We received this error at the network level:
  &amp;gt; Error: connect ECONNREFUSED {ip for app-url}:8443

Common situations why this would fail:

  - you don&amp;apos;t have internet access
      - you forgot to run / boot your web server
      - your web server isn&amp;apos;t accessible
      - you have weird network configuration settings on your computer&quot; type=&quot;CypressError&quot;&gt;&lt;![CDATA[CypressError: `cy.visit()` failed trying to load:
    
    https://app-url:8443/
    We attempted to make an http request to this URL but the request failed without a response.
    We received this error at the network level:
      &gt; Error: connect ECONNREFUSED 192.168.208.6:8443
    Common situations why this would fail:
      - you don't have internet access
      - you forgot to run / boot your web server
      - your web server isn't accessible
      - you have weird network configuration settings on your computer
        at http://app-url:8080/__cypress/runner/cypress_runner.js:138876:23
        at visitFailedByErr (http://app-url:8080/__cypress/runner/cypress_runner.js:138235:12)
        at http://app-url:8080/__cypress/runner/cypress_runner.js:138875:11
        at tryCatcher (http://app-url:8080/__cypress/runner/cypress_runner.js:10791:23)
        at Promise._settlePromiseFromHandler (http://app-url:8080/__cypress/runner/cypress_runner.js:8726:31)
        at Promise._settlePromise (http://app-url:8080/__cypress/runner/cypress_runner.js:8783:18)
        at Promise._settlePromise0 (http://app-url:8080/__cypress/runner/cypress_runner.js:8828:10)
        at Promise._settlePromises (http://app-url:8080/__cypress/runner/cypress_runner.js:8904:18)
        at _drainQueueStep (http://app-url:8080/__cypress/runner/cypress_runner.js:5498:12)
        at _drainQueue (http://app-url:8080/__cypress/runner/cypress_runner.js:5491:9)
        at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://app-url:8080/__cypress/runner/cypress_runner.js:5507:5)
        at Async.drainQueues (http://app-url:8080/__cypress/runner/cypress_runner.js:5377:14)
    From Your Spec Code:
        at Context.eval (http://app-url:8080/__cypress/tests?p=cypress/integration/tests/simple-login.spec.js:162:12)   
    From Node.js Internals:
      Error: connect ECONNREFUSED 192.168.208.6:8443
          at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
      ]]&gt;&lt;/failure&gt;
        &lt;/testcase&gt;
      &lt;/testsuite&gt;
    &lt;/testsuites&gt;
</code></pre>
<p>This is the yml with the steps for drone:</p>
<pre><code>- name: test ui
    image: image for test ui
    volumes:
      - name: cypress_results
        path: app/cypress/results
      - name: cypress_screenshots
        path: app/cypress/screenshots
      - name: cypress_videos
        path: app/cypress/videos
    commands:
      - ./docker/app/wait-for.sh http://app-url:8360/ --&gt; Bash file that makes drone wait until that url can be reached
      - cd test
      - npm install
      - npx cypress run --config baseUrl=http://app-url:8360/ --spec &quot;cypress/integration/**/*&quot; --env testuser=user,testuserpw=pwd
</code></pre>
<p><strong>Attempts to solve the problem:</strong></p>
<ol>
<li>Checked ports, even changed ports to match them</li>
<li>Removed cy.visit(), which leads to a pass</li>
<li>Checked for correct Cypress Version</li>
<li>Checked in KeyCloak for the redirection url.</li>
<li>Project tested locally with CLI. Test could also be executed successfully</li>
<li>Internet connection has been established with a bridge in docker compose</li>
<li>Checked for availability of the website. In the yml file you can see the marking for a bash file which makes drone wait until the website has been established</li>
</ol>
<p><strong>Question:</strong>
Are there any workarounds? If yes, what will it be? Has it to do with the container itself?</p>
",https://stackoverflow.com/questions/67713649/how-can-i-access-redirect-url-from-keycloak-inside-docker-container-with-cy-visi,"['yaml', 'cypress', 'drone.io']",539,False,1,0
