title,body,link,tags,view_count,is_answered,score,answer_count
Nuxt end to end testing with jest,"<p>Hello im searching for a way to use component testing as well as end to end testing with nuxt.</p>
<p>we want to be able to test components (which already works) and also check if pages parse their url parameters correctly or sitemaps are correctly created and other page level features and router functions</p>
<p>i tried ava but we already implemented the component testing with jest which works fine now and in the nuxt docs the server rendering for testing was described with ava and i adapted that to jest now but i get timeout errors so i increased the time out to 40 seconds but still get a timeout.</p>
<p>did anybody get the testing to work with the nuxt builder like in the example (<a href=""https://nuxtjs.org/guide/development-tools"" rel=""nofollow noreferrer"">https://nuxtjs.org/guide/development-tools</a>)?</p>
<p>this is my end to end test example file</p>
<pre class=""lang-js prettyprint-override""><code>// test.spec.js:
const { resolve } = require('path')
const { Nuxt, Builder } = require('nuxt')

// We keep the nuxt and server instance
// So we can close them at the end of the test
let nuxt = null

// Init Nuxt.js and create a server listening on localhost:4000
beforeAll(async (done) =&gt; {
  jest.setTimeout(40000)

  const config = {
    dev: false,
    rootDir: resolve(__dirname, '../..'),
    telemetry: false,
  }
  nuxt = new Nuxt(config)
  try {
    await new Builder(nuxt).build()
    nuxt.server.listen(4000, 'localhost')
  } catch (e) {
    console.log(e)
  }

  done()
}, 30000)
describe('testing nuxt', () =&gt; {
  // Example of testing only generated html
  test('Route / exits and render HTML', async (t, done) =&gt; {
    const context = {}
    const { html } = await nuxt.server.renderRoute('/', context)
    t.true(html.includes('&lt;h1 class=&quot;red&quot;&gt;Hello world!&lt;/h1&gt;'))
    jest.setTimeout(30000)
    done()
  })
})
// Close server and ask nuxt to stop listening to file changes
afterAll((t) =&gt; {
  nuxt.close()
})

</code></pre>
<p>my current error is :</p>
<pre><code> ● Test suite failed to run

    Timeout - Async callback was not invoked within the 40000ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 40000ms timeout specified by jest.setTimeout.
</code></pre>
<p>any info is very appreciated as i could not resolve this issue myself</p>
",https://stackoverflow.com/questions/64065988/nuxt-end-to-end-testing-with-jest,"['testing', 'jestjs', 'nuxt.js']",478,False,3,0
"Jest, NestJS, TypeORM End To End Testing","<p>In the NestJS tutorial E2E tests are set up with their single example module imported.
This pattern does not seem to work in an application with more complex relations between the typeORM entities. After extensively checking that there were <a href=""https://github.com/typeorm/typeorm/issues/420"" rel=""nofollow noreferrer"">no inconsistencies in import statements</a> and no missing <a href=""https://github.com/typeorm/typeorm/issues/420#issuecomment-611474412"" rel=""nofollow noreferrer""><code>TypeOrmModule.forFeature()</code></a> in the relevant files, I gave up and simply imported my entire <code>AppModule</code> (root module for my application -- same as NestJS default).</p>
",https://stackoverflow.com/questions/64471996/jest-nestjs-typeorm-end-to-end-testing,"['jestjs', 'linker-errors', 'nestjs', 'e2e-testing', 'typeorm']",452,True,2,1
Error Spring get Jacoco coverage End-to-end testing,"<p>I'm trying to get end-to-end test coverage with Jacoco which is based on API hit, not by running unit test. I followed this tutorial:
<a href=""https://dzone.com/articles/code-coverage-report-generator-for-java-projects-a"" rel=""noreferrer"">https://dzone.com/articles/code-coverage-report-generator-for-java-projects-a</a></p>

<p>However I got this error:</p>

<pre><code>Caused by: java.lang.LinkageError: loader 'bootstrap' attempted duplicate class definition for java.lang.$JaCoCo. (java.lang.$JaCoCo is in module java.base of loader 'bootstrap')
</code></pre>

<p>I don't know what cause the error:
The project uses gradle and I also apply jacoco plugin for unit test (I need coverage for both unit test and end-to-end test).</p>

<p>But I'm not sure if that cause the <code>LinkageError</code> because if I remove all jacoco related things from gradle, the same error still appears.</p>

<p>How to properly setup jacoco coverage for end-to-end testing with gradle? If not possible, is there any alternative?</p>
",https://stackoverflow.com/questions/59606256/error-spring-get-jacoco-coverage-end-to-end-testing,"['spring', 'gradle', 'jacoco']",542,False,8,0
End to end testing - delete or keep records,"<p>What is the best way to handle records in the database after end-to-end tests have passed? Should we change affected records <code>deleted_at</code> column to the current date or remove these records at all since new tests will create more new records all the time?</p>

<p>The system will ignore those records with <code>deleted_at</code> flag but at the same time every new test will add new records and it will be equal for trashing database.</p>

<p>What is the best practice to use? </p>
",https://stackoverflow.com/questions/61954393/end-to-end-testing-delete-or-keep-records,"['testing', 'jestjs', 'end-to-end']",396,True,0,1
Vue SPA with Laravel Backend End-To-End Testing,"<p>I have two separate projects, a Vue SPA and a Laravel backend.</p>

<p>Now, I would like to write some end-to-end tests from our Vue SPA to our Laravel backend. I would like to write SPA tests which make real backend API calls. But the Laravel API should know that this are testing calls and handle them like when running tests with phpunit. So this calls should use the .env.testing or the phpunit.xml env settings, e.g. use the testing database and testing mail provider. </p>

<p>So is there a possibility to tell Laravel, that it should handle a request with env = testing?</p>

<p>I've found an old <a href=""https://m.dotdev.co/acceptance-testing-a-laravel-and-vue-js-application-4160b8e96156"" rel=""nofollow noreferrer"">article from Mohamed Said</a> which goes in this direction, with setting a cookie. But I hope there is an easier way, especially with loading the whole .env.testing variables?</p>

<p>Thanks a lot.</p>
",https://stackoverflow.com/questions/61727341/vue-spa-with-laravel-backend-end-to-end-testing,"['laravel', 'testing', 'integration-testing']",337,True,0,2
Spring boot docker application end-to-end Testing with chrome driver,"<p>I already have Unit and Integration tests with maven but I'm trying to move end-to-end testing with angular(frontend) to maven so I can have every layer of the testing pyramid connected within the same maven build but i'm having trouble doing so.</p>
<p>My spring boot application has some dependencies like postgres and keycloak. I was trying to &quot;mock&quot; does dependencies (in unit and integration tests i use postgres with testcontainers) so i can have an isolated environment without depending on external services are running or not.</p>
<p>I managed to open chrome and do some clicks with selenium and chrome driver but all of this is running on my local database and frontend application which i need to have it up and running. I want something that i can integrate with jenkins later on so i need something to work isolated.</p>
<p>I searched on the internet but i could't find any scenario like this. Anyone could help?</p>
",https://stackoverflow.com/questions/63052014/spring-boot-docker-application-end-to-end-testing-with-chrome-driver,"['java', 'spring', 'maven', 'selenium-chromedriver', 'end-to-end']",541,False,1,1
How to perform end-to-end testing in Kubernetes using sonobuoy,"<p>OS: Ubuntu 18.04
These are the set of commands we executed to obtain the result of sonobuoy.
This is to perform Kubernetes end to end(or conformance) testing.</p>

<pre><code>ubuntu@masternode:~$sonobuoy run
ubuntu@masternode:~$ results=$(sonobuoy retrieve)
ubuntu@masternode:~$ sonobuoy results $results
Plugin: e2e
Status: unknown
Total: 0
Passed: 0
Failed: 0
Skipped: 0
</code></pre>

<p>Issue: we are getting the status as unknown and total count as 0 and so on. But when we try the dryrun, we get the details as shown in the below.</p>

<pre><code>ubuntu@masternode:~$sonobuoy run --plugin-env e2e.E2E_FOCUS=pods --plugin-env e2e.E2E_DRYRUN=true
ubuntu@masternode:~$ results=$(sonobuoy retrieve)
ubuntu@masternode:~/bin$ sonobuoy results $results
Plugin: e2e
Status: passed
Total: 4413
Passed: 354
Failed: 0
Skipped: 4059
</code></pre>

<p>Can anyone help us to fix this issue? or Share other ways to do end-to-end test in Kubernetes. </p>

<p>please find below the details for the logs</p>

<pre><code>ubuntu@masternode:~$ sonobuoy status
PLUGINSTATUSRESULTCOUNT
e2ecompleteunknown1
systemd-logscompletepassed1
systemd-logscomplete9

Sonobuoy has completed. Use `sonobuoy retrieve` to get results.

ubuntu@masternode:~$ results=$(sonobuoy retrieve)
ubuntu@masternode:~$ sonobuoy results $results
Plugin: e2e
Status: unknown
Total: 0
Passed: 0
Failed: 0
Skipped: 0

Plugin: systemd-logs
Status: passed
Total: 10
Passed: 10
Failed: 0
Skipped: 0
ubuntu@masternode:~$
</code></pre>

<p>Please find below the complete log information.</p>

<pre><code>I0122 14:06:44.242882      19 test_context.go:406] Using a temporary kubeconfig file from in-cluster config : /tmp/kubeconfig-629324578
I0122 14:06:44.242936      19 test_context.go:419] Tolerating taints ""node-role.kubernetes.io/master"" when considering if nodes are ready
I0122 14:06:44.245332      19 e2e.go:109] Starting e2e run ""eee1f5b8-9b6f-46f7-a8c1-61f771ceee41"" on Ginkgo node 1
{""msg"":""Test Suite starting"",""total"":278,""completed"":0,""skipped"":0,""failed"":0}
Running Suite: Kubernetes e2e suite
===================================
Random Seed: 1579702001 - Will randomize all specs
Will run 278 of 4814 specs

Jan 22 14:06:44.324: INFO: &gt;&gt;&gt; kubeConfig: /tmp/kubeconfig-629324578
Jan 22 14:06:44.360: INFO: Waiting up to 30m0s for all (but 0) nodes to be schedulable
Jan 22 14:06:44.428: INFO: Waiting up to 10m0s for all pods (need at least 0) in namespace 'kube-system' to be running and ready
Jan 22 14:06:44.485: INFO: 10 / 10 pods in namespace 'kube-system' are running and ready (0 seconds elapsed)
Jan 22 14:06:44.485: INFO: expected 3 pod replicas in namespace 'kube-system', 3 are Running and Ready.
Jan 22 14:06:44.485: INFO: Waiting up to 5m0s for all daemonsets in namespace 'kube-system' to start
Jan 22 14:06:44.494: INFO: 1 / 1 pods ready in namespace 'kube-system' in daemonset 'kube-proxy' (0 seconds elapsed)
Jan 22 14:06:44.494: INFO: e2e test version: v1.17.0
Jan 22 14:06:44.497: INFO: kube-apiserver version: v1.17.0
Jan 22 14:06:44.499: INFO: &gt;&gt;&gt; kubeConfig: /tmp/kubeconfig-629324578
Jan 22 14:06:44.536: INFO: Cluster IP family: ipv4
SSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
[sig-api-machinery] ResourceQuota 
  should create a ResourceQuota and ensure its status is promptly calculated. [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
[BeforeEach] [sig-api-machinery] ResourceQuota
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:151
STEP: Creating a kubernetes client
Jan 22 14:06:44.538: INFO: &gt;&gt;&gt; kubeConfig: /tmp/kubeconfig-629324578
STEP: Building a namespace api object, basename resourcequota
Jan 22 14:06:44.867: INFO: No PodSecurityPolicies found; assuming PodSecurityPolicy is disabled.
STEP: Waiting for a default service account to be provisioned in namespace
[It] should create a ResourceQuota and ensure its status is promptly calculated. [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
STEP: Counting existing ResourceQuota
STEP: Creating a ResourceQuota
STEP: Ensuring resource quota status is calculated
[AfterEach] [sig-api-machinery] ResourceQuota
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:152
Jan 22 14:06:52.167: INFO: Waiting up to 3m0s for all (but 0) nodes to be ready
STEP: Destroying namespace ""resourcequota-6723"" for this suite.

• [SLOW TEST:7.655 seconds]
[sig-api-machinery] ResourceQuota
/workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/apimachinery/framework.go:23
  should create a ResourceQuota and ensure its status is promptly calculated. [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
------------------------------
{""msg"":""PASSED [sig-api-machinery] ResourceQuota should create a ResourceQuota and ensure its status is promptly calculated. [Conformance]"",""total"":278,""completed"":1,""skipped"":28,""failed"":0}
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
[sig-network] DNS 
  should provide DNS for ExternalName services [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
[BeforeEach] [sig-network] DNS
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:151
STEP: Creating a kubernetes client
Jan 22 14:06:52.240: INFO: &gt;&gt;&gt; kubeConfig: /tmp/kubeconfig-629324578
STEP: Building a namespace api object, basename dns
STEP: Waiting for a default service account to be provisioned in namespace
[It] should provide DNS for ExternalName services [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
STEP: Creating a test externalName service
STEP: Running these commands on wheezy: for i in `seq 1 30`; do dig +short dns-test-service-3.dns-5567.svc.cluster.local CNAME &gt; /results/wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local; sleep 1; done

STEP: Running these commands on jessie: for i in `seq 1 30`; do dig +short dns-test-service-3.dns-5567.svc.cluster.local CNAME &gt; /results/jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local; sleep 1; done

STEP: creating a pod to probe DNS
STEP: submitting the pod to kubernetes
STEP: retrieving the pod
STEP: looking for the results for each expected name from probers
Jan 22 14:07:03.221: INFO: DNS probes using dns-test-6066c047-1fcb-4fae-a7d1-dd929f2e0339 succeeded

STEP: deleting the pod
STEP: changing the externalName to bar.example.com
STEP: Running these commands on wheezy: for i in `seq 1 30`; do dig +short dns-test-service-3.dns-5567.svc.cluster.local CNAME &gt; /results/wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local; sleep 1; done

STEP: Running these commands on jessie: for i in `seq 1 30`; do dig +short dns-test-service-3.dns-5567.svc.cluster.local CNAME &gt; /results/jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local; sleep 1; done

STEP: creating a second pod to probe DNS
STEP: submitting the pod to kubernetes
STEP: retrieving the pod
STEP: looking for the results for each expected name from probers
Jan 22 14:07:12.319: INFO: File wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local from pod  dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 contains '' instead of 'bar.example.com.'
Jan 22 14:07:12.327: INFO: File jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local from pod  dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 contains 'foo.example.com.
' instead of 'bar.example.com.'
Jan 22 14:07:12.327: INFO: Lookups using dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 failed for: [wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local]

Jan 22 14:07:17.400: INFO: File wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local from pod  dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 contains 'foo.example.com.
' instead of 'bar.example.com.'
Jan 22 14:07:17.409: INFO: File jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local from pod  dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 contains 'foo.example.com.
' instead of 'bar.example.com.'
Jan 22 14:07:17.409: INFO: Lookups using dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 failed for: [wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local]

Jan 22 14:07:22.447: INFO: File wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local from pod  dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 contains 'foo.example.com.
' instead of 'bar.example.com.'
Jan 22 14:07:22.469: INFO: File jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local from pod  dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 contains 'foo.example.com.
' instead of 'bar.example.com.'
Jan 22 14:07:22.469: INFO: Lookups using dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 failed for: [wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local]

Jan 22 14:07:27.359: INFO: File wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local from pod  dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 contains 'foo.example.com.
' instead of 'bar.example.com.'
Jan 22 14:07:27.372: INFO: File jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local from pod  dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 contains 'foo.example.com.
' instead of 'bar.example.com.'
Jan 22 14:07:27.372: INFO: Lookups using dns-5567/dns-test-30128437-ecc3-4c91-b41d-334389a55e70 failed for: [wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local]

Jan 22 14:07:32.360: INFO: DNS probes using dns-test-30128437-ecc3-4c91-b41d-334389a55e70 succeeded

STEP: deleting the pod
STEP: changing the service to type=ClusterIP
STEP: Running these commands on wheezy: for i in `seq 1 30`; do dig +short dns-test-service-3.dns-5567.svc.cluster.local A &gt; /results/wheezy_udp@dns-test-service-3.dns-5567.svc.cluster.local; sleep 1; done

STEP: Running these commands on jessie: for i in `seq 1 30`; do dig +short dns-test-service-3.dns-5567.svc.cluster.local A &gt; /results/jessie_udp@dns-test-service-3.dns-5567.svc.cluster.local; sleep 1; done

STEP: creating a third pod to probe DNS
STEP: submitting the pod to kubernetes
STEP: retrieving the pod
STEP: looking for the results for each expected name from probers
Jan 22 14:07:42.321: INFO: DNS probes using dns-test-90181d81-8194-4eef-9c53-7f8a5a358926 succeeded

STEP: deleting the pod
STEP: deleting the test externalName service
[AfterEach] [sig-network] DNS
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:152
Jan 22 14:07:42.744: INFO: Waiting up to 3m0s for all (but 0) nodes to be ready
STEP: Destroying namespace ""dns-5567"" for this suite.

• [SLOW TEST:50.771 seconds]
[sig-network] DNS
/workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/network/framework.go:23
  should provide DNS for ExternalName services [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
------------------------------
{""msg"":""PASSED [sig-network] DNS should provide DNS for ExternalName services [Conformance]"",""total"":278,""completed"":2,""skipped"":64,""failed"":0}
SS
------------------------------
[sig-storage] Projected downwardAPI 
  should set mode on item file [LinuxOnly] [NodeConformance] [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
[BeforeEach] [sig-storage] Projected downwardAPI
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:151
STEP: Creating a kubernetes client
Jan 22 14:07:43.020: INFO: &gt;&gt;&gt; kubeConfig: /tmp/kubeconfig-629324578
STEP: Building a namespace api object, basename projected
STEP: Waiting for a default service account to be provisioned in namespace
[BeforeEach] [sig-storage] Projected downwardAPI
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/common/projected_downwardapi.go:40
[It] should set mode on item file [LinuxOnly] [NodeConformance] [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
STEP: Creating a pod to test downward API volume plugin
Jan 22 14:07:44.199: INFO: Waiting up to 5m0s for pod ""downwardapi-volume-14c007eb-95d5-4542-beb9-86eff0d7f3f4"" in namespace ""projected-8175"" to be ""success or failure""
Jan 22 14:07:44.267: INFO: Pod ""downwardapi-volume-14c007eb-95d5-4542-beb9-86eff0d7f3f4"": Phase=""Pending"", Reason="""", readiness=false. Elapsed: 67.814089ms
Jan 22 14:07:46.403: INFO: Pod ""downwardapi-volume-14c007eb-95d5-4542-beb9-86eff0d7f3f4"": Phase=""Pending"", Reason="""", readiness=false. Elapsed: 2.203995191s
Jan 22 14:07:48.566: INFO: Pod ""downwardapi-volume-14c007eb-95d5-4542-beb9-86eff0d7f3f4"": Phase=""Pending"", Reason="""", readiness=false. Elapsed: 4.366650294s
Jan 22 14:07:50.636: INFO: Pod ""downwardapi-volume-14c007eb-95d5-4542-beb9-86eff0d7f3f4"": Phase=""Succeeded"", Reason="""", readiness=false. Elapsed: 6.436737299s
STEP: Saw pod success
Jan 22 14:07:50.639: INFO: Pod ""downwardapi-volume-14c007eb-95d5-4542-beb9-86eff0d7f3f4"" satisfied condition ""success or failure""
Jan 22 14:07:50.752: INFO: Trying to get logs from node minikube pod downwardapi-volume-14c007eb-95d5-4542-beb9-86eff0d7f3f4 container client-container: &lt;nil&gt;
STEP: delete the pod
Jan 22 14:07:51.157: INFO: Waiting for pod downwardapi-volume-14c007eb-95d5-4542-beb9-86eff0d7f3f4 to disappear
Jan 22 14:07:51.263: INFO: Pod downwardapi-volume-14c007eb-95d5-4542-beb9-86eff0d7f3f4 no longer exists
[AfterEach] [sig-storage] Projected downwardAPI
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:152
Jan 22 14:07:51.277: INFO: Waiting up to 3m0s for all (but 0) nodes to be ready
STEP: Destroying namespace ""projected-8175"" for this suite.

• [SLOW TEST:8.319 seconds]
[sig-storage] Projected downwardAPI
/workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/common/projected_downwardapi.go:34
  should set mode on item file [LinuxOnly] [NodeConformance] [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
------------------------------
{""msg"":""PASSED [sig-storage] Projected downwardAPI should set mode on item file [LinuxOnly] [NodeConformance] [Conformance]"",""total"":278,""completed"":3,""skipped"":66,""failed"":0}
SSSSSSSSSS
------------------------------
[sig-api-machinery] ResourceQuota 
  should verify ResourceQuota with best effort scope. [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
[BeforeEach] [sig-api-machinery] ResourceQuota
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:151
STEP: Creating a kubernetes client
Jan 22 14:07:51.351: INFO: &gt;&gt;&gt; kubeConfig: /tmp/kubeconfig-629324578
STEP: Building a namespace api object, basename resourcequota
STEP: Waiting for a default service account to be provisioned in namespace
[It] should verify ResourceQuota with best effort scope. [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
STEP: Creating a ResourceQuota with best effort scope
STEP: Ensuring ResourceQuota status is calculated
STEP: Creating a ResourceQuota with not best effort scope
STEP: Ensuring ResourceQuota status is calculated
STEP: Creating a best-effort pod
STEP: Ensuring resource quota with best effort scope captures the pod usage
STEP: Ensuring resource quota with not best effort ignored the pod usage
STEP: Deleting the pod
STEP: Ensuring resource quota status released the pod usage
STEP: Creating a not best-effort pod
STEP: Ensuring resource quota with not best effort scope captures the pod usage
STEP: Ensuring resource quota with best effort scope ignored the pod usage
STEP: Deleting the pod
STEP: Ensuring resource quota status released the pod usage
[AfterEach] [sig-api-machinery] ResourceQuota
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:152
Jan 22 14:08:09.870: INFO: Waiting up to 3m0s for all (but 0) nodes to be ready
STEP: Destroying namespace ""resourcequota-4593"" for this suite.

• [SLOW TEST:18.553 seconds]
[sig-api-machinery] ResourceQuota
/workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/apimachinery/framework.go:23
  should verify ResourceQuota with best effort scope. [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
------------------------------
{""msg"":""PASSED [sig-api-machinery] ResourceQuota should verify ResourceQuota with best effort scope. [Conformance]"",""total"":278,""completed"":4,""skipped"":76,""failed"":0}
SS
------------------------------
[sig-storage] Projected configMap 
  should be consumable from pods in volume with mappings and Item mode set [LinuxOnly] [NodeConformance] [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
[BeforeEach] [sig-storage] Projected configMap
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:151
STEP: Creating a kubernetes client
Jan 22 14:08:09.911: INFO: &gt;&gt;&gt; kubeConfig: /tmp/kubeconfig-629324578
STEP: Building a namespace api object, basename projected
STEP: Waiting for a default service account to be provisioned in namespace
[It] should be consumable from pods in volume with mappings and Item mode set [LinuxOnly] [NodeConformance] [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
STEP: Creating configMap with name projected-configmap-test-volume-map-f038deb5-0ddd-40d1-9407-453ccd62068f
STEP: Creating a pod to test consume configMaps
Jan 22 14:08:10.345: INFO: Waiting up to 5m0s for pod ""pod-projected-configmaps-13bfc9cd-1c74-47d6-8e92-31be083da410"" in namespace ""projected-1124"" to be ""success or failure""
Jan 22 14:08:10.451: INFO: Pod ""pod-projected-configmaps-13bfc9cd-1c74-47d6-8e92-31be083da410"": Phase=""Pending"", Reason="""", readiness=false. Elapsed: 106.024979ms
Jan 22 14:08:12.584: INFO: Pod ""pod-projected-configmaps-13bfc9cd-1c74-47d6-8e92-31be083da410"": Phase=""Pending"", Reason="""", readiness=false. Elapsed: 2.239448334s
Jan 22 14:08:14.635: INFO: Pod ""pod-projected-configmaps-13bfc9cd-1c74-47d6-8e92-31be083da410"": Phase=""Pending"", Reason="""", readiness=false. Elapsed: 4.289832483s
Jan 22 14:08:16.711: INFO: Pod ""pod-projected-configmaps-13bfc9cd-1c74-47d6-8e92-31be083da410"": Phase=""Succeeded"", Reason="""", readiness=false. Elapsed: 6.36605145s
STEP: Saw pod success
Jan 22 14:08:16.712: INFO: Pod ""pod-projected-configmaps-13bfc9cd-1c74-47d6-8e92-31be083da410"" satisfied condition ""success or failure""
Jan 22 14:08:16.807: INFO: Trying to get logs from node minikube pod pod-projected-configmaps-13bfc9cd-1c74-47d6-8e92-31be083da410 container projected-configmap-volume-test: &lt;nil&gt;
STEP: delete the pod
Jan 22 14:08:17.020: INFO: Waiting for pod pod-projected-configmaps-13bfc9cd-1c74-47d6-8e92-31be083da410 to disappear
Jan 22 14:08:17.030: INFO: Pod pod-projected-configmaps-13bfc9cd-1c74-47d6-8e92-31be083da410 no longer exists
[AfterEach] [sig-storage] Projected configMap
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:152
Jan 22 14:08:17.034: INFO: Waiting up to 3m0s for all (but 0) nodes to be ready
STEP: Destroying namespace ""projected-1124"" for this suite.

• [SLOW TEST:7.226 seconds]
[sig-storage] Projected configMap
/workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/common/projected_configmap.go:34
  should be consumable from pods in volume with mappings and Item mode set [LinuxOnly] [NodeConformance] [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
------------------------------
{""msg"":""PASSED [sig-storage] Projected configMap should be consumable from pods in volume with mappings and Item mode set [LinuxOnly] [NodeConformance] [Conformance]"",""total"":278,""completed"":5,""skipped"":78,""failed"":0}
SSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
[k8s.io] Pods 
  should contain environment variables for services [NodeConformance] [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721
[BeforeEach] [k8s.io] Pods
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:151
STEP: Creating a kubernetes client
Jan 22 14:08:17.145: INFO: &gt;&gt;&gt; kubeConfig: /tmp/kubeconfig-629324578
STEP: Building a namespace api object, basename pods
STEP: Waiting for a default service account to be provisioned in namespace
[BeforeEach] [k8s.io] Pods
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/common/pods.go:177
[It] should contain environment variables for services [NodeConformance] [Conformance]
  /workspace/anago-v1.17.0-rc.2.10+70132b0f130acc/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/framework.go:721

Ginkgo ran 1 suite in 1m38.668464378s
Test Suite Failed
</code></pre>
",https://stackoverflow.com/questions/59845281/how-to-perform-end-to-end-testing-in-kubernetes-using-sonobuoy,['kubernetes'],470,False,1,0
spring boot microservice end to end testing with cucumber and database verification,"<p>My project is based on event-driven microservice architecture. And We are trying to do end to end testing with cucumber, so that feature under test is available in a Business readable format.</p>

<p>Details are as below. 
Service Architecture: </p>

<p>There are 4 microservice involved. We send the request to Service A, and request gets processed and stored in DB, and Service A publish the event, which gets consumed by Service B, again Service B process the event and store the result in DB and publish the event to be consumed by Service C and like that Service D.</p>

<p>User(Post Request to Service A) Service A -> (Process, Store in DB and Publish event To Service B) -> Service b(Consume event from A, process and Store result in DB, publish an event to C)...</p>

<p>Testing Strategy:
As part of the end to end testing, we will send the post request to Service A. and Service A will return only response 200 with no response Body.</p>

<p>We need to do verification of data in Each Service DB and assert that, it is as expected.</p>

<p>Something like feature file </p>

<p>Given
The system is in the expected state.
When
Send Request to service A
And
Service  returns 200 response
And
Verify Processed Data is present in Service A DB
And 
Verify Processed Data is present in Service B DB
And
Verify Processed Data is present in Service C DB</p>

<p>**I want to understand, 
 1. what should be the right way to do this kind of testing. </p>

<ol start=""2"">
<li>Is this the correct approach to do the end to end testing and verification in DB or some other approach should be used.**</li>
</ol>
",https://stackoverflow.com/questions/59599431/spring-boot-microservice-end-to-end-testing-with-cucumber-and-database-verificat,"['spring-boot', 'cucumber', 'microservices', 'bdd', 'spring-test']",583,True,0,1
How to improve time spent on end to end testing using codeceptjs?,"<p>we are using codeceptjs for e2e tests for my work. For every code submission, we run these tests (we use webpack-dev-server to mock the backend).</p>
<p>In the beginning, the time spent to run these tests is acceptable. However after 1 year we have around 900 tests (i.e. CodeCept's Scenarios) and it takes around 1 hour to finish. Basically after finishing a feature we add some tests and for bugs we also add e2e test. We realize this is not sustainable if we keep adding more e2e tests since it takes to long to run. Do you have any suggestions how can I improve them ( we are using codeceptjs ) ?</p>
<p>I am thinking about only running some e2e tests for important features for each submission, the rests should be run separately ( maybe once per day ). Thanks.</p>
",https://stackoverflow.com/questions/63838729/how-to-improve-time-spent-on-end-to-end-testing-using-codeceptjs,"['e2e-testing', 'codeceptjs']",42,False,0,0
How do I do end to end testing of a Springboot API?,"<p>I have the following test class to test my API, and I have the following code structure:</p>

<p><code>package controller -&gt; UserController.java</code>
<code>package service -&gt; UserService.java</code>
<code>package repository -&gt; UserRepository.java</code></p>

<p><code>package endtoend -&gt; EndToEndTest.java</code></p>

<pre><code>@WebMvcTest(UserController.class)
class EndToEndTest {

@Autowired
private MockMvc mockMvc;

@Test
void shouldReturn200() throws Exception{
    mockMvc.perform(get(""/users/{username}"", ""testUser""))
            .andExpect(status().isOk());
}
</code></pre>

<p><strong><em>UserController.java</em></strong> has a Get mapping -> <code>@GetMapping(""/users/{username}"")</code></p>

<p>But the test is returning an error that the application failed to start and it's missing bean of type UserService.</p>

<p>I feel that I am missing some mocks, as my controller calls service and service calls repository.</p>

<p>Please help!</p>
",https://stackoverflow.com/questions/59663951/how-do-i-do-end-to-end-testing-of-a-springboot-api,"['java', 'spring-boot', 'mocking', 'junit5', 'mockmvc']",861,True,0,1
What is the best approach for Automation End To End Testing in an ETL Project?,"<p>We have an ETL Project wherein Data from one UI application flows down in a series of applications(Transformation/Logic).</p>
<p>The overall motto is to see the data of 'UI 1' in 'UI 2'.
'Spring Java Server 1' calls the API of UI1 Server and the data gets flow into different servers and persisted in the database. A script also persists some data in the database.
'UI 2 with Backend server' gets the data from database and show it in the UI.</p>
<p><a href=""https://i.stack.imgur.com/DpCQP.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/DpCQP.png"" alt=""enter image description here"" /></a></p>
<p>Now the question,
I am looking for the best possible way to perform E2E testing.
We'll start by triggering 'Spring Java Server 1' which calls APIs of 'UI 1 with BackendServer 1' and at the end using selenium see the data in 'UI 2'.</p>
<p>I am thinking about creating a separate Java Application with UI just for testing which triggers the 'Server 1' and with selenium verifies the UI2
But the problem is with Script. After the database, we have to manually run script and then wait for it to complete. How we can automate manually running the script with some kind of state Management?</p>
<p>Please suggest more on the architecture of E2E  or how can i enhance this E2E setup. And what tools/framework i can use.</p>
",https://stackoverflow.com/questions/63735864/what-is-the-best-approach-for-automation-end-to-end-testing-in-an-etl-project,"['java', 'testing', 'automated-tests', 'integration-testing', 'end-to-end']",340,False,0,1
Couchbase Lite pull replication fails with error in a sample Couchbase Mobile End to End testing project,"<p>I am getting started with Couchbase Mobile. The feature that I am most interested (for now) is <code>PULL</code> replication (keep data on mobile in sync with backend database). </p>

<p>I followed the steps described in <a href=""https://blog.couchbase.com/using-docker-with-couchbase-mobile/"" rel=""noreferrer"">Using Docker to develop with Couchbase Mobile</a> and have got the Couchbase server (enterprise-6.5.0) and sync gateway (2.7.0-enterprise) deployed locally. I have added the <code>beer-sample</code> database (has ~8400 documents) and now I'm trying to replicate it on an android application. I customized the <a href=""https://github.com/couchbaselabs/userprofile-couchbase-mobile-android"" rel=""noreferrer"">Userprofile Couchbase Mobile Android</a> project and I pointed it to my local sync-gateway. I have a piece of code to replicate like below :</p>

<pre><code>  public static void startPullReplication() {
    Log.i(""Pull"", ""Start pull beer-sample"");
    URI url = null;
    try {
      url = new URI(String.format(""%s/%s"", ""ws://10.0.1.7:4984"", beerSampleDbName));
    } catch (URISyntaxException e) {
      e.printStackTrace();
    }

    ReplicatorConfiguration config =
        new ReplicatorConfiguration(beerSampleDatabase, new URLEndpoint(url)); // &lt;1&gt;
    config.setReplicatorType(ReplicatorConfiguration.ReplicatorType.PULL); // &lt;2&gt;
    config.setContinuous(true); // &lt;3&gt;
    config.setAuthenticator(new BasicAuthenticator(""admin"", ""password"")); // &lt;4&gt;
    //    config.setChannels(Arrays.asList(""channel."" + ""admin"")); // &lt;5&gt;

    replicator = new Replicator(config);
    replicatorListenerToken =
        replicator.addChangeListener(
            new ReplicatorChangeListener() {
              @Override
              public void changed(ReplicatorChange change) {
                Log.i(""Pull"", ""Changed pull beer sample : "" + change.getStatus());
                if (change
                    .getReplicator()
                    .getStatus()
                    .getActivityLevel()
                    .equals(Replicator.ActivityLevel.IDLE)) {
                  Log.i(""Replication Comp Log"", ""Scheduler Completed"");
                }
                if (change
                        .getReplicator()
                        .getStatus()
                        .getActivityLevel()
                        .equals(Replicator.ActivityLevel.STOPPED)
                    || change
                        .getReplicator()
                        .getStatus()
                        .getActivityLevel()
                        .equals(Replicator.ActivityLevel.OFFLINE)) {
                  Log.i(""Rep Scheduler  Log"", ""ReplicationTag Stopped"");
                }
              }
            });
    replicator.start();

    Log.i(""Pull"", ""Replication beer-sample started"");
  }
</code></pre>

<p>and listen to changes in the db like below :</p>

<pre><code>
  private void registerForDatabaseChanges() {
    beerSampleListenerToken =
        beerSampleDatabase.addChangeListener(
            new DatabaseChangeListener() {
              Integer i=0;
              @Override
              public void changed(@NonNull DatabaseChange change) {
                Log.i(""DatabaseChangeEvent"", String.valueOf(i));
                i++;
                for (String docId : change.getDocumentIDs()) {
                  Document doc = beerSampleDatabase.getDocument(docId);
                  if (doc != null) {
                    Log.i(""DatabaseChangeEvent"", doc.getId() + "": Document was added/updated"");
                  } else {
                    Log.i(""DatabaseChangeEvent"", docId + ""Document was deleted"");
                  }
                }
              }
            });
  }

</code></pre>

<p>Now when I run the app I am getting the following logs.</p>

<pre><code>2020-02-11 15:44:46.420 22513-22513/com.cbmob.testapp W/CouchbaseLite/DATABASE: Database.log.getFile().getConfig() is null, meaning file logging is disabled.  Log files required for product support are not being generated.
2020-02-11 15:44:46.615 22513-22545/com.cbmob.testapp D/OpenGLRenderer: HWUI GL Pipeline
2020-02-11 15:44:46.744 22513-22545/com.cbmob.testapp I/zygote: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-02-11 15:44:46.744 22513-22545/com.cbmob.testapp I/OpenGLRenderer: Initialized EGL, version 1.4
2020-02-11 15:44:46.744 22513-22545/com.cbmob.testapp D/OpenGLRenderer: Swap behavior 1
2020-02-11 15:44:46.745 22513-22545/com.cbmob.testapp W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2020-02-11 15:44:46.745 22513-22545/com.cbmob.testapp D/OpenGLRenderer: Swap behavior 0
2020-02-11 15:44:46.752 22513-22545/com.cbmob.testapp D/EGL_emulation: eglCreateContext: 0xa9f30d40: maj 3 min 0 rcv 3
2020-02-11 15:44:46.765 22513-22545/com.cbmob.testapp D/EGL_emulation: eglMakeCurrent: 0xa9f30d40: ver 3 0 (tinfo 0x9f7bf880)
2020-02-11 15:44:46.976 22513-22545/com.cbmob.testapp D/EGL_emulation: eglMakeCurrent: 0xa9f30d40: ver 3 0 (tinfo 0x9f7bf880)



2020-02-11 15:44:56.458 22513-22513/com.cbmob.testapp I/Pull: Start pull beer-sample
2020-02-11 15:44:56.480 22513-22576/com.cbmob.testapp W/CouchbaseLite/NETWORK: C4Socket.open() socket -&gt; 2852069288
2020-02-11 15:44:56.480 22513-22576/com.cbmob.testapp W/CouchbaseLite/NETWORK: C4Socket.open() clazz -&gt; com.couchbase.lite.internal.replicator.CBLWebSocket
2020-02-11 15:44:56.482 22513-22513/com.cbmob.testapp I/Pull: Replication beer-sample started
2020-02-11 15:44:56.497 22513-22513/com.cbmob.testapp I/Pull: Changed pull beer sample : Status{activityLevel=CONNECTING, progress=Progress{completed=0, total=0}, error=null}
2020-02-11 15:44:56.519 22513-22576/com.cbmob.testapp D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-02-11 15:44:56.528 22513-22576/com.cbmob.testapp E/CouchbaseLite/NETWORK: CBLWebSocket.socket_open()
2020-02-11 15:44:56.582 22513-22576/com.cbmob.testapp W/CouchbaseLite/NETWORK: C4Socket.write() handle -&gt; 2852069288
2020-02-11 15:44:56.586 22513-22576/com.cbmob.testapp W/CouchbaseLite/NETWORK: completedWrite(long) handle -&gt; 2852069288, byteCount -&gt; 68
2020-02-11 15:44:56.591 22513-22513/com.cbmob.testapp I/Pull: Changed pull beer sample : Status{activityLevel=BUSY, progress=Progress{completed=0, total=0}, error=null}
2020-02-11 15:44:56.591 22513-22576/com.cbmob.testapp W/CouchbaseLite/NETWORK: C4Socket.write() handle -&gt; 2852069288
2020-02-11 15:44:56.592 22513-22576/com.cbmob.testapp W/CouchbaseLite/NETWORK: completedWrite(long) handle -&gt; 2852069288, byteCount -&gt; 121
2020-02-11 15:44:56.605 22513-22577/com.cbmob.testapp W/CouchbaseLite/NETWORK: C4Socket.completedReceive() handle -&gt; 2852069288
2020-02-11 15:44:56.608 22513-22577/com.cbmob.testapp I/chatty: uid=10086(com.cbmob.testapp) Thread-9 identical 1 line
2020-02-11 15:44:56.612 22513-22577/com.cbmob.testapp W/CouchbaseLite/NETWORK: C4Socket.completedReceive() handle -&gt; 2852069288
2020-02-11 15:44:56.627 22513-22513/com.cbmob.testapp I/Pull: Changed pull beer sample : Status{activityLevel=IDLE, progress=Progress{completed=0, total=0}, error=null}
2020-02-11 15:44:56.628 22513-22513/com.cbmob.testapp E/Replication Comp Log: Scheduler Completed
</code></pre>

<p>Clearly the document changes in the db are not being logged. From this, I am assuming that the replication is not at all happening. I am not sure how to go about debugging this. If anyone has any pointers on how this can be debugged, I would appreciate it. If needed, I could post the sync gateway logs.</p>

<p>If anyone has any links to any blogspots or projects which explains how to get all the pieces working together, kindly share that.</p>

<p>Looking forward to hearing back from people.</p>
",https://stackoverflow.com/questions/60166800/couchbase-lite-pull-replication-fails-with-error-in-a-sample-couchbase-mobile-en,"['android', 'couchbase', 'couchbase-lite', 'couchbase-sync-gateway']",574,True,8,1
How to do end to end testing better against a distributed system using a github PR workflow?,"<p>My team uses an internal e2e testing framework to test that everything from the http request to the http response is working as expected.</p>

<p>How these tests work is very complicated and flaky due to the nature of a distributed architecture across multiple geographies in AWS.</p>

<p>A big problem we have is that when we merge a feature PR into one of our many micro-services/lambdas that impact the response/behaviour of an endpoint, our e2e tests fail.</p>

<p>How we deal with this is by accepting that the e2e Jenkins job will be red temporarily until someone gets an e2e PR merged that updates/adds a test/s.</p>

<p>Because of the acceptance of the e2e job being red ""temporarily"", it leads to other changes that may or may not contain bugs slipping in.</p>

<p>The other problem is that we don't allow PRs to be merged if the build is failing (which is great), but if the e2e tests fail due to a change in a different service, the person fixing the e2e tests for the feature they are working on will need to fix the other failures in the same PR.</p>

<p>So my question is, what can my team do to fix this problem?</p>

<p>I want us to keep the e2e tests as they are very useful, but they're prone to be neglected for the reasons above.</p>

<p>Could we somehow tie the e2e tests repo to each feature branch so that when someone pushes code to a branch, a feature branch with the same name on our e2e test service runs against it and blocks the PR until they update the e2e tests?</p>

<ul>
<li>This would need the e2e test repo to somehow be linked so that code changes there appear in the feature PR for the relevant service/lambda. Not sure if this possible.</li>
</ul>

<p>Any advice/examples on how to do e2e testing using the github workflow for a distributed micro-services/lambda architecture in AWS would be extremely appreciated.</p>

<p>Also, I would find it hard to believe my team is the only one with this problem. So maybe this will help others.</p>
",https://stackoverflow.com/questions/59791202/how-to-do-end-to-end-testing-better-against-a-distributed-system-using-a-github,"['git', 'amazon-web-services', 'jenkins', 'github', 'e2e-testing']",1006,True,2,1
End-to-end testing in React Native with Detox [does not render the assets and the images],"<p>I'm new to the detox framework and end-to-end testing on react native.</p>

<p>I followed all the steps described in this tutorial (<a href=""https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md"" rel=""nofollow noreferrer"">https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md</a>)</p>

<p>I managed to start the ""detox test"", but unfortunately, I don't know why the apk generated, does not render the assets and the images correctly.</p>

<p>as you can see below the differences between the apk generated by detox and mocha, and the real apk generated by the react-native run-android command :</p>

<p><strong>apk generated by the react-native run-android command :</strong></p>

<p><a href=""https://i.stack.imgur.com/ueJB0.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/ueJB0.png"" alt=""enter image description here""></a></p>

<p><strong>apk generated by the  command  detox build --configuration android.emu.debug :</strong></p>

<p><a href=""https://i.stack.imgur.com/66nQD.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/66nQD.png"" alt=""enter image description here""></a></p>

<p>Is it like the ""assets"" that it did not generate correctly with the second command ?</p>

<p>Thanks you.</p>
",https://stackoverflow.com/questions/62244837/end-to-end-testing-in-react-native-with-detox-does-not-render-the-assets-and-th,"['android', 'react-native', 'jestjs', 'mocha.js', 'detox']",254,False,2,0
How can I run a shell script as a setup file in Jest?,"<p>Something like this. The goal is to start and stop my test server as part of the jest setup so I can do end to end testing with a single command.</p>

<pre class=""lang-js prettyprint-override""><code>""jest"": {
  ""setupFiles"": [""&lt;rootDir&gt;/TestScript.sh""]
} 
</code></pre>
",https://stackoverflow.com/questions/59723815/how-can-i-run-a-shell-script-as-a-setup-file-in-jest,"['shell', 'jestjs', 'yarnpkg', 'end-to-end']",3585,True,4,2
Does testcafe support soft assertions,"<p>I have a scenario that is an end to end testing where I have multiple assertion points. Observed that when an assertion fails test stops. But I need to just report a failed step in test results and proceed further with the test execution. Does Test cafe support soft assertions?</p>
",https://stackoverflow.com/questions/60407390/does-testcafe-support-soft-assertions,"['testing', 'automated-tests', 'e2e-testing', 'assertion', 'testcafe']",297,True,1,1
UI integration tests for vscode extensions,"<p>I want to implement end to end testing for my vscode extension. For command we implemented in package.json &amp; run tasks intergated that takes input parameter as pickString, promptString, etc. How to write intergation test case to pick UI elements in vscode?</p>

<p>Do we have any sample UI integration tests for vscode extensions?</p>
",https://stackoverflow.com/questions/61210294/ui-integration-tests-for-vscode-extensions,"['visual-studio-code', 'vscode-extensions']",881,False,2,1
Does waitForElementVisible not search for input elements?,"<p>I am using nightwatch.js to perform end-to-end testing and have to use a roundabout method for a <code>waitForElementVisible</code> <a href=""https://v12.nightwatchjs.org/api/waitForElementVisible.html"" rel=""nofollow noreferrer"">command</a> to work as expected. For example, my code below:</p>

<pre><code>browser.waitForElementVisible("".profile label[for='Admin']"") // works
browser.waitForElementVisible("".profile label[for='Admin'] input[id='Admin']"") // breaks
</code></pre>

<p>For further clarification, I am testing to see if a radio button is visible. The radio button's DOM elements is as such:</p>

<pre class=""lang-html prettyprint-override""><code>&lt;div class='profile'&gt;
  &lt;div class='roleSelector'&gt;
    &lt;label for=""Admin""&gt;
      &lt;input type=""radio"" id=""Admin"" class=""Admin""&gt;
    &lt;/label&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>
",https://stackoverflow.com/questions/59955577/does-waitforelementvisible-not-search-for-input-elements,"['e2e-testing', 'nightwatch.js', 'nightwatch']",97,False,0,1
Is there a way to show the &quot;clicks&quot; in Android Espresso UI testing?,"<p>We use Firebase Test Lab for our automated end to end testing, its been requested that we show the &quot;clicks&quot; so someone can follow along, being that all animations are disabled during a UI test is it possible to setup Espresso or Firebase to show the clicks as the test runner executes?</p>
",https://stackoverflow.com/questions/64779874/is-there-a-way-to-show-the-clicks-in-android-espresso-ui-testing,"['android-espresso', 'firebase-test-lab']",141,False,1,1
How to do load testing in real browsers[Not HTTP based load testing like JMeter] in testcafe?,"<p>We are using testcafe for end to end testing,But we have one requirement like 10 different users logins simultaniously[parallelly] to different page and each user uploads different excel files.Is it possible to acheive is testcafe or any other opensource tool is available in market for load testing in real browser?</p>
",https://stackoverflow.com/questions/63316066/how-to-do-load-testing-in-real-browsersnot-http-based-load-testing-like-jmeter,"['testing', 'automation', 'automated-tests', 'e2e-testing', 'testcafe']",108,False,0,0
ng e2e --configuration=e2e in Azure DevOps running for a long time,"<p>I have an angular web page where I am trying to run E2E testing in Azure DevOps Pipeline.</p>
<p>But my end to end testing is running for a long time and does not produce any result.</p>
<p>Not sure what I am missing, I have shared my configuration below.</p>
<p>angular.json</p>
<pre><code>&quot;e2e&quot;: {
         &quot;fileReplacements&quot;: [
              {
                      &quot;replace&quot;: &quot;src/app/core/services/auth.service.ts&quot;,
                      &quot;with&quot;: &quot;src/app/core/services/auth.service.mock.ts&quot;
               }
            ]
}
</code></pre>
<p>package.json</p>
<pre><code>&quot;scripts&quot;: {
    &quot;ng&quot;: &quot;ng&quot;,
    &quot;start&quot;: &quot;ng serve&quot;,
    &quot;build&quot;: &quot;ng build&quot;,
    &quot;build-prod&quot;: &quot;ng build --prod&quot;,
    &quot;test&quot;: &quot;ng test&quot;,
    &quot;lint&quot;: &quot;ng lint&quot;,
    &quot;e2e&quot;: &quot;ng e2e --configuration=e2e&quot;  
 }
</code></pre>
<p>protractor.conf.js</p>
<pre><code>capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      args: [&quot;--incognito&quot;]
    }
  },
  chromeDriver: '../node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_87.0.4280.88',
  baseUrl: 'http://localhost:4200/login',
  framework: 'custom',
  ignoreUncaughtExceptions: true,
  frameworkPath: require.resolve('protractor-cucumber-framework'),
</code></pre>
<p>My Pipele Yml:</p>
<pre><code>- task: Npm@1
      displayName: 'npm Install'
      inputs:
        command: 'install'
        workingDir: './'
    - script: | 
                $(Agent.BuildDirectory)/s/node_modules/protractor/bin/webdriver-manager update --versions.chrome=chromedriver_87.0.4280.88
    - task: Npm@1
      displayName: 'E2E Testing'
      inputs:
        command: 'custom'
        workingDir: './'
        customCommand: 'run e2e'
</code></pre>
",https://stackoverflow.com/questions/65310141/ng-e2e-configuration-e2e-in-azure-devops-running-for-a-long-time,"['angular', 'azure-devops', 'protractor', 'e2e-testing']",387,True,0,1
How to use multiple authentication plugins in the same service in Kong,"<p>I am looking to use Cypress for end to end testing for some kubernetes applications. Typically,  I access these applications via OIDC through kong, however cypress doesn't support this,  but does support key-auth via an API key. Is there a way of setting up the service so that I can use both of these simultaneously?</p>
",https://stackoverflow.com/questions/63470805/how-to-use-multiple-authentication-plugins-in-the-same-service-in-kong,"['kubernetes', 'devops', 'cypress', 'kong', 'kong-plugin']",949,True,1,1
Make TestCafe show an object diff,"<p>We're using TestCafe for end-to-end testing, and I'm finding myself looking at an error like this:</p>

<pre><code>AssertionError: expected [ Array(5) ] to deeply equal [ Array(5) ]
</code></pre>

<p>I'd like error messages like this to include a diff. I know object diffing modules are available on npm, but I'd like to add it in such a way that I don't have to import this library any time I'm asserting object equality.</p>
",https://stackoverflow.com/questions/59722434/make-testcafe-show-an-object-diff,"['javascript', 'assert', 'e2e-testing', 'testcafe', 'end-to-end']",156,True,1,2
Run external spring boot application as part of an integration test,"<p>Is it possible to run an external Spring boot application from an integration test? The basic idea is that I have a mock service that was developed for use in end to end testing and would like to be able to have the e2e integration test take care of starting up the service and shutting it down as part of the test.</p>
",https://stackoverflow.com/questions/65332321/run-external-spring-boot-application-as-part-of-an-integration-test,"['spring-boot', 'integration-testing']",104,False,0,1
spring boot microservice end to end testing with cucumber and database verification,"<p>My project is based on event-driven microservice architecture. And We are trying to do end to end testing with cucumber, so that feature under test is available in a Business readable format.</p>

<p>Details are as below. 
Service Architecture: </p>

<p>There are 4 microservice involved. We send the request to Service A, and request gets processed and stored in DB, and Service A publish the event, which gets consumed by Service B, again Service B process the event and store the result in DB and publish the event to be consumed by Service C and like that Service D.</p>

<p>User(Post Request to Service A) Service A -> (Process, Store in DB and Publish event To Service B) -> Service b(Consume event from A, process and Store result in DB, publish an event to C)...</p>

<p>Testing Strategy:
As part of the end to end testing, we will send the post request to Service A. and Service A will return only response 200 with no response Body.</p>

<p>We need to do verification of data in Each Service DB and assert that, it is as expected.</p>

<p>Something like feature file </p>

<p>Given
The system is in the expected state.
When
Send Request to service A
And
Service  returns 200 response
And
Verify Processed Data is present in Service A DB
And 
Verify Processed Data is present in Service B DB
And
Verify Processed Data is present in Service C DB</p>

<p>**I want to understand, 
 1. what should be the right way to do this kind of testing. </p>

<ol start=""2"">
<li>Is this the correct approach to do the end to end testing and verification in DB or some other approach should be used.**</li>
</ol>
",https://stackoverflow.com/questions/59599431/spring-boot-microservice-end-to-end-testing-with-cucumber-and-database-verificat,"['spring-boot', 'cucumber', 'microservices', 'bdd', 'spring-test']",583,True,0,1
How can I run multiple commands in package.json scripts?,"<p>I'm using <code>detox</code> for end-to-end testing my react-native app. When I try to run <code>yarn detox build -c android.emu.release</code> it does not run the script well <code>cd android ; ./gradlew assembleRelease app:assembleAndroidTest -DtestBuildType=release ; cd -</code>. This script was generated automatically by <code>detox init</code>.</p>

<p>Here is my <code>package.json</code> file:</p>

<pre><code>{
  ""detox"": {
    /*...*/
    ""android.emu.release"": {
        ""binaryPath"": ""android/app/build/outputs/apk/release/app-release.apk"",
        ""build"": ""cd android  ./gradlew assembleRelease app:assembleAndroidTest -DtestBuildType=release ; cd -"", //&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
        ""type"": ""android.emulator"",
        ""device"": {
          ""avdName"": ""NexusOneAPI29""
        }
      }
    /*...*/
  },
  /*...*/
}
</code></pre>

<p>I am struggling to run <code>yarn detox build -c android.emu.release</code> for instance. If </p>

<h3>Which symbol/char do I need to use to concat commands instead of <code>;</code> on detox?</h3>

<p>The main error I believe is: <code>The system cannot find the path specified.</code> extracted from below.</p>

<pre class=""lang-none prettyprint-override""><code>$ yarn detox-build                                                  
yarn run v1.21.1
detox[7600] INFO:  [build.js] cd android ; gradlew assembleRelease app:assembleAndroidTest -DtestBuildType=release ; cd -
The system cannot find the path specified.
detox[7600] ERROR: [cli.js] Error: Command failed: cd android ; gradlew assembleRelease app:assembleAndroidTest -DtestBuildType=releas
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
</code></pre>
",https://stackoverflow.com/questions/59886960/how-can-i-run-multiple-commands-in-package-json-scripts,"['javascript', 'android', 'powershell', 'react-native', 'package.json']",5833,True,0,1
Testcafe - Fresh browser session is launched for each test in a fixture. How can we avoid this,"<p>I have a scenario which is an end to end testing.</p>

<p>test1 - Add a setup</p>

<p>test2 - Generate template for the data</p>

<p>test3 - Link Github to the setup</p>

<p>test4 - perform some actions in Github and validate data</p>

<p>I created a fixture with test1, test2, test3, and test4. But observed that fresh browser session is launched for each test. How can I continue my testing from test1 to test4 without interrupting the browser session</p>
",https://stackoverflow.com/questions/60375430/testcafe-fresh-browser-session-is-launched-for-each-test-in-a-fixture-how-can,"['testing', 'automation', 'automated-tests', 'e2e-testing', 'testcafe']",534,True,1,1
React-Select: How to Add a Custom ClassName for Each Option of Dropdown?,"<p>I want to add a custom class name in each <strong>option</strong> of <strong>React-select dropdown</strong>. Later, to use that class name as the reference and click with <strong>Puppeteer</strong> for an end to end testing.</p>
<p>Right now when I click on drop-down, it has dynamic classes and when want to debug the HTML structure, dropdown closes and HTML also disappears.</p>
<p>The code is as follows:</p>
<pre><code>&lt;Select
    options={this.loadSuppliers()}
    value={this.props.supplierPicker ? this.props.supplierPicker : []}
    defaultValue={
        this.state.SupplierId
    }
    isSearchable={true}
    onChange={this.onChangeSupplier}
    id=&quot;supplier&quot;
    &gt;
&lt;/Select&gt;
</code></pre>
<p>supplierPick has JSON with value and label as keys.</p>
",https://stackoverflow.com/questions/62715010/react-select-how-to-add-a-custom-classname-for-each-option-of-dropdown,"['puppeteer', 'react-select']",594,False,1,0
Karate UI - Find html element via attribute where name contains special charatcers,"<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 element contains special charatcers like below</p>

<pre><code>&lt;input autocapitalize=""none"" autocomplete=""on"" autocorrect=""off"" name=""session[username_or_email]"" spellcheck=""false"" type=""text"" dir=""auto"" data-focusable=""true"" class=""r-30o5oe r-1niwhzg r-17gur6a r-1yadl64 r-deolkf r-homxoj r-poiln3 r-7cikom r-1ny4l3l r-1inuy60 r-utggzx r-vmopo1 r-1w50u8q r-1lrr6ok r-1dz5y72 r-1ttztb7 r-13qz1uu"" value=""""&gt;
</code></pre>

<p>This is the html snippet taken from Twitter login page. To get this control I have tried various options from mentioned below but couldn't able to find the control</p>

<p><strong>Option 1</strong></p>

<pre><code>  Given driver 'https://twitter.com/login'
  And input('#session[username_or_email]',['aaaa@gmail.com',Key.ENTER], 100)
  And input('#session[password]',['asasas', Key.ENTER], 100)
  When submit().click(""click('{span}Log in')"")
  #* def elements = locateAll('{div}Click Me')
  Then locate('.css-901oao').exists
</code></pre>

<p><strong>Option 2</strong></p>

<pre><code>  Given driver 'https://twitter.com/login'
  And input('input[name=session[username_or_email]]', 'aaaa@gmail.com')
  When submit().click(""click('{span}Log in')"")
  Then locate('.css-901oao').exists
</code></pre>

<p>I above tried options I couldn't able to find input and span button. Any help or pointer will be very helpful.</p>
",https://stackoverflow.com/questions/61185776/karate-ui-find-html-element-via-attribute-where-name-contains-special-charatce,['karate'],1737,True,1,1
Problem running Hyperledger Fabric network on Ubuntu 18.04 - BYFN.SH Up,"<p>I get stuck after running &quot; ./byfn.sh up &quot;. The end-to-end testing does not reach the end. I get stuck at the following:</p>
<p>Querying chaincode on peer0.org1... ===================== Querying on peer0.org1 on channel 'mychannel'... ===================== Attempting to Query peer0.org1 ...3 secs</p>
<p>peer chaincode query -C mychannel -n mycc -c '{&quot;Args&quot;:[&quot;query&quot;,&quot;a&quot;]}'</p>
<p>That is as far as it gets. I have installed all the requirements using root permission. Reinstalled everything, purged containers, and restarted the system many times and always get the same result. Any help would be appreciated.</p>
",https://stackoverflow.com/questions/63499504/problem-running-hyperledger-fabric-network-on-ubuntu-18-04-byfn-sh-up,"['ubuntu', 'hyperledger-fabric', 'hyperledger']",102,False,-1,1
Using only one credential to do load testing,"<p>Im currently new to end to end testing and planning to do load testing for a website I am currently working on. Im currently looking into jmeter and studying how to use it. My question is, would it make sense to only use one credential for the test? So basically I will be using my credentials then would throwing same HTTP requests multiple times to the server to simulate several users logging in and using the website.</p>
<p>Also if there are other ways to do load testing without using more than one credentials would be helpful!</p>
<p>Thanks in advance for the help!</p>
",https://stackoverflow.com/questions/64387272/using-only-one-credential-to-do-load-testing,"['jmeter', 'performance-testing', 'load-testing']",202,True,-1,1
Error Spring get Jacoco coverage End-to-end testing,"<p>I'm trying to get end-to-end test coverage with Jacoco which is based on API hit, not by running unit test. I followed this tutorial:
<a href=""https://dzone.com/articles/code-coverage-report-generator-for-java-projects-a"" rel=""noreferrer"">https://dzone.com/articles/code-coverage-report-generator-for-java-projects-a</a></p>

<p>However I got this error:</p>

<pre><code>Caused by: java.lang.LinkageError: loader 'bootstrap' attempted duplicate class definition for java.lang.$JaCoCo. (java.lang.$JaCoCo is in module java.base of loader 'bootstrap')
</code></pre>

<p>I don't know what cause the error:
The project uses gradle and I also apply jacoco plugin for unit test (I need coverage for both unit test and end-to-end test).</p>

<p>But I'm not sure if that cause the <code>LinkageError</code> because if I remove all jacoco related things from gradle, the same error still appears.</p>

<p>How to properly setup jacoco coverage for end-to-end testing with gradle? If not possible, is there any alternative?</p>
",https://stackoverflow.com/questions/59606256/error-spring-get-jacoco-coverage-end-to-end-testing,"['spring', 'gradle', 'jacoco']",542,False,8,0
End-to-end testing in React Native with Detox [does not render the assets and the images],"<p>I'm new to the detox framework and end-to-end testing on react native.</p>

<p>I followed all the steps described in this tutorial (<a href=""https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md"" rel=""nofollow noreferrer"">https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md</a>)</p>

<p>I managed to start the ""detox test"", but unfortunately, I don't know why the apk generated, does not render the assets and the images correctly.</p>

<p>as you can see below the differences between the apk generated by detox and mocha, and the real apk generated by the react-native run-android command :</p>

<p><strong>apk generated by the react-native run-android command :</strong></p>

<p><a href=""https://i.stack.imgur.com/ueJB0.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/ueJB0.png"" alt=""enter image description here""></a></p>

<p><strong>apk generated by the  command  detox build --configuration android.emu.debug :</strong></p>

<p><a href=""https://i.stack.imgur.com/66nQD.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/66nQD.png"" alt=""enter image description here""></a></p>

<p>Is it like the ""assets"" that it did not generate correctly with the second command ?</p>

<p>Thanks you.</p>
",https://stackoverflow.com/questions/62244837/end-to-end-testing-in-react-native-with-detox-does-not-render-the-assets-and-th,"['android', 'react-native', 'jestjs', 'mocha.js', 'detox']",254,False,2,0
@SpringBootTest how to pre-populate embedded MongoDB?,"<p>Doing implementation of a microservice with a few endpoints based on <code>Spring Boot</code> and <code>MongoDB</code> and trying to write integration tests using <code>@SpringBootTest</code> annotation capabilities.</p>

<p>At the moment, I am facing an issue that I need to pre-populate an embedded <code>MongoDB</code> instance that instantiated only during 'test' phrase with some test data.</p>

<p>And I did not find any out-of-the-box option available in <code>Spring Boot</code> for this purpose.</p>

<p>Some people advice to use for test data pre-populating tools like <a href=""https://github.com/mongobee/mongobee"" rel=""nofollow noreferrer"">mongobee</a> or <a href=""https://github.com/pvpkiran/mongoprefill"" rel=""nofollow noreferrer"">mongoprefill</a> or <a href=""https://github.com/lordofthejars/nosql-unit"" rel=""nofollow noreferrer"">nosql-unit</a> but for me, it seems like overhead or workaround, do not want to introduce any new dependencies even in test scope.</p>

<p>So could you please advice: In the current <code>Spring Boot</code> ecosystem, what is the right way to pre-populate <code>MongoDB</code> for testing purpose, when we are talking about integration (end-to-end) testing with <code>@SpringBootTest</code>?</p>
",https://stackoverflow.com/questions/60627126/springboottest-how-to-pre-populate-embedded-mongodb,"['mongodb', 'spring-boot', 'integration-testing', 'spring-boot-test']",820,True,3,1
Cypress Angular When Can Test Start?,"<p>I'm using Cypress to do end-to-end testing on my Angular application. One source of flake that I have observed is that Cypress is fast to act and my application is (relatively) slow to become ready for interaction. Cypress has some oft-referenced <a href=""https://www.cypress.io/blog/2018/02/05/when-can-the-test-start/"" rel=""nofollow noreferrer"">blog</a> <a href=""https://www.cypress.io/blog/2019/01/22/when-can-the-test-click/"" rel=""nofollow noreferrer"">posts</a> that discuss this quandary.</p>
<p>The example in one of the blog posts suggests hijacking the addEventListener to handle a very specific example. But what I am looking for is the appropriate &quot;sledgehammer&quot; for Angular... anyone have any bright ideas / techniques that don't involve adding a 10 second wait to every page visit before engaging test activity (which by the way <em>does</em> work)? I have spent considerable time Googling to no avail. Thanks in advance for your ideas!</p>
<p>Aside: I've also found <a href=""https://github.com/cypress-io/cypress/issues/1773"" rel=""nofollow noreferrer"">this open issue</a> that, were it to be resolved fruitfully <em>might</em> be part of the answer.</p>
",https://stackoverflow.com/questions/64880285/cypress-angular-when-can-test-start,"['javascript', 'angular', 'testing', 'cypress']",1091,True,7,2
How to reference local import when patching - proper python testing structure,"<p>I have a Starlette app and I'm attempting to perform end to end testing on the entire application. A function defined in a.py is called by a function in b.py through a local import, and for testing purpose I would like to replace the function with a self defined function when testing.</p>
<p>Like others, I'm running into issues getting the path string to work. After looking at existing questions on stackoverflow, I think I'm supposed to be patching the reference in b.py, but run into the following error <code>AttributeError: &lt;function b at 0x7f5298087af0&gt; does not have the attribute 'a'</code></p>
<p>Here's the relevant structure and code</p>
<pre><code>    Project_folder
      - app
        - lib
          + __init__.py
          + a.py
          + b.py
        - handle
          + __init__.py
      - test
        + test.py
      + main.py
</code></pre>
<pre><code>    #a.py
    def a(id):
      return stuff
</code></pre>
<pre><code>    #b.py
    from .a import a
    def b():
      return a(some_stuff)
</code></pre>
<pre><code>    #lib.__init__py
    from .a import a
    from .b import b
</code></pre>
<p>routes refers to an async function which calls b somewhere in the code</p>
<pre><code>   #main.py
   from starlette.applications import Starlette
   from handle import routes

   app = Starlette(routes=routes)
</code></pre>
<p>My attempt at test.py</p>
<pre><code>from starlette.testclient import TestClient
from main import app
import pytest
from mock import patch

client = TestClient(app)

def mock_a(id):
    return 'some value'

@patch('app.lib.b.a', new=mock_a)
def test_app(request):
    response = client.post('/route', request)
    assert response.status_code == 200
</code></pre>
<p>I'm very new to mocks and patching, and would appreciate any advice on how I should be setting this up</p>
",https://stackoverflow.com/questions/64795136/how-to-reference-local-import-when-patching-proper-python-testing-structure,"['python', 'mocking', 'pytest', 'monkeypatching', 'python-mock']",117,False,1,1
Best way to test complex user flows in Cypress?,"<p>I am creating an end to end testing solution in Cypress for an application which essentially has the following flow:</p>
<p>Admin Creates user -&gt; User validates their account -&gt; User logs in -&gt; User is able to perform various actions and go through a long process flow</p>
<p>I have previously created long custom commands in cypress to handle this (eg cy.login, cy.createUser()) but this doesn't look great and I feel this will become harder to manage as I add more tests.</p>
<p>So my question is, is there a recommended pattern that I should be using to generate user flows for testing in Cypress?</p>
<p>I would like to introduce dynamic data into the flow the user goes onto (which involves a lot of form filling). But not sure the best way to go about this.</p>
",https://stackoverflow.com/questions/63090092/best-way-to-test-complex-user-flows-in-cypress,"['javascript', 'cypress']",570,True,1,1
Cypress.io doesn&#39;t persist Auth0 login for Angular app,"<p>I followed the Auth0 tutorial (<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>) for using Cypress.io but I'm not able to get Cypress to persist a successful sign-in.</p>
<p>I am able to sign in with the Cypress Login command, but as soon as I redirect to another page, my auth.guard (which checks for Auth0 login status), prompts for login again and I get this error in Cypress:</p>
<pre><code>myapp.auth0.com refused to connect.
</code></pre>
<p>And in the console: <code>Refused to frame 'https://myapp.auth0.com/' because an ancestor violates the following Content Security Policy directive: &quot;frame-ancestors 'none'&quot;.</code></p>
<p>So the auth guard is not finding the login. I suspect this might be because Cypress is clearing cookies and local storage, but I haven't found a workaround.</p>
<p>I tried adding this (from some old code I had) to the top of the test file, but it didn't help.</p>
<pre><code>const clear = Cypress.LocalStorage.clear
Cypress.LocalStorage.clear = function (keys, ls, rs) {
  if (keys) {  }
}
</code></pre>
<p>And in the test:</p>
<pre><code>beforeEach(() =&gt; {
    cy.restoreLocalStorageCache();
  });

...

afterEach(() =&gt; {
    cy.saveLocalStorageCache();
  });
</code></pre>
",https://stackoverflow.com/questions/63442737/cypress-io-doesnt-persist-auth0-login-for-angular-app,"['angular', 'testing', 'cypress', 'auth0']",670,True,1,1
501 Invalid Request,"<p>I am using exchangelib for some end-to-end testing purposes of our mail system. Currently, when making a request, I am returned a 501.</p>

<pre><code># Tell exchangelib to use this adapter class instead of the default
BaseProtocol.HTTP_ADAPTER_CLS = NoVerifyHTTPAdapter

...

version = Version(api_version=""Exchange2013_SP1"", build=Build(15, 0, 847))
credentials = Credentials(username=outlook_profile['Username'], password=outlook_profile['Password'])
config = Configuration(server=""&lt;SERVICEURL&gt;"", credentials=credentials, auth_type=NTLM, version=version)
account = Account(primary_smtp_address=""&lt;USER&gt;@&lt;DOMAIN&gt;"", config=config, autodiscover=False, access_type=DELEGATE)

print(account.inbox.total_count)
</code></pre>

<p>Error:</p>

<pre><code>WARNING:exchangelib.services.common:EWS https://&lt;SERVICEURL&gt;/EWS/Exchange.asmx, account &lt;USER&gt;@&lt;DOMAIN&gt;: Exception in _get_elements: Traceback (most recent call last):
  File ""C:\Python38\lib\site-packages\cached_property.py"", line 69, in __get__
    return obj_dict[name]
KeyError: 'root'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ""C:\Python38\lib\site-packages\exchangelib\services\common.py"", line 84, in _get_elements
    response = self._get_response_xml(payload=payload)
  File ""C:\Python38\lib\site-packages\exchangelib\services\common.py"", line 150, in _get_response_xml
    r, session = post_ratelimited(
  File ""C:\Python38\lib\site-packages\exchangelib\util.py"", line 770, in post_ratelimited
    _raise_response_errors(r, protocol, log_msg, log_vals)  # Always raises an exception
  File ""C:\Python38\lib\site-packages\exchangelib\util.py"", line 851, in _raise_response_errors
    raise TransportError(str('Unknown failure\n') + log_msg % log_vals)
exchangelib.errors.TransportError: Unknown failure
Retry: 0
Waited: 10
Timeout: 120
Session: 24770
Thread: 34952
Auth type: &lt;requests_ntlm.requests_ntlm.HttpNtlmAuth object at 0x000001B2F697A310&gt;
URL: https://&lt;SERVICEURL&gt;/EWS/Exchange.asmx
HTTP adapter: &lt;exchangelib.protocol.NoVerifyHTTPAdapter object at 0x000001B2F697A0A0&gt;
Allow redirects: False
Streaming: False
Response time: 0.0779999999795109
Status code: 501
Request headers: {'User-Agent': 'exchangelib/3.2.0 (python-requests/2.23.0)', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'Keep-Alive', 'Content-Type': 'text/xml; charset=utf-8', 'X-AnchorMailbox': '&lt;USER&gt;@&lt;DOMAIN&gt;', 'Content-Length': '1304', 'Authorization': 'NTLM &lt;HASH&gt;'}
Response headers: {'Date': 'Wed, 10 Jun 2020 21:38:09 GMT', 'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'Connection': 'close', 'Content-Length': '87', 'Content-Type': 'text/html'}
Request data: b'&lt;?xml version=\'1.0\' encoding=\'utf-8\'?&gt;\n&lt;s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:m=""http://schemas.microsoft.com/exchange/services/2006/messages"" xmlns:t=""http://schemas.microsoft.com/exchange/services/2006/types""&gt;&lt;s:Header&gt;&lt;t:RequestServerVersion Version=""Exchange2013_SP1""/&gt;&lt;t:ExchangeImpersonation&gt;&lt;t:ConnectingSID&gt;&lt;t:PrimarySmtpAddress&gt;&lt;USER&gt;@&lt;DOMAIN&gt;&lt;/t:PrimarySmtpAddress&gt;&lt;/t:ConnectingSID&gt;&lt;/t:ExchangeImpersonation&gt;&lt;t:TimeZoneContext&gt;&lt;t:TimeZoneDefinition Id=""UTC""/&gt;&lt;/t:TimeZoneContext&gt;&lt;/s:Header&gt;&lt;s:Body&gt;&lt;m:GetFolder&gt;&lt;m:FolderShape&gt;&lt;t:BaseShape&gt;IdOnly&lt;/t:BaseShape&gt;&lt;t:AdditionalProperties&gt;&lt;t:FieldURI FieldURI=""folder:FolderId""/&gt;&lt;t:FieldURI FieldURI=""folder:ChildFolderCount""/&gt;&lt;t:FieldURI FieldURI=""folder:EffectiveRights""/&gt;&lt;t:FieldURI FieldURI=""folder:FolderClass""/&gt;&lt;t:FieldURI FieldURI=""folder:DisplayName""/&gt;&lt;t:FieldURI FieldURI=""folder:ParentFolderId""/&gt;&lt;t:FieldURI FieldURI=""folder:TotalCount""/&gt;&lt;t:FieldURI FieldURI=""folder:UnreadCount""/&gt;&lt;/t:AdditionalProperties&gt;&lt;/m:FolderShape&gt;&lt;m:FolderIds&gt;&lt;t:DistinguishedFolderId Id=""root""&gt;&lt;t:Mailbox&gt;&lt;t:EmailAddress&gt;&lt;USER&gt;@&lt;DOMAIN&gt;&lt;/t:EmailAddress&gt;&lt;t:RoutingType&gt;SMTP&lt;/t:RoutingType&gt;&lt;t:MailboxType&gt;Mailbox&lt;/t:MailboxType&gt;&lt;/t:Mailbox&gt;&lt;/t:DistinguishedFolderId&gt;&lt;/m:FolderIds&gt;&lt;/m:GetFolder&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;'
Response data: b'&lt;html&gt;&lt;head&gt;&lt;title&gt;501 Invalid Request&lt;/title&gt;&lt;/head&gt;&lt;body&gt;Invalid Request: ??&lt;/body&gt;\r\n'
</code></pre>

<p>However, when I connect (successfully) to my email system using a powershell EWS library, I can see that my Request body looks quite different, especially in terms of the <code>soap:Envelope</code> tag:</p>

<pre><code>POST https://&lt;SERVICEURL&gt;/EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0847.030
Accept-Encoding: gzip,deflate
Authorization: NTLM &lt;HASH&gt;
Host: &lt;SERVICEURL&gt;
Content-Length: 673
Expect: 100-continue

&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;
&lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:m=""http://schemas.microsoft.com/exchange/services/2006/messages"" xmlns:t=""http://schemas.microsoft.com/exchange/services/2006/types"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;
  &lt;soap:Header&gt;
    &lt;t:RequestServerVersion Version=""Exchange2013_SP1"" /&gt;
  &lt;/soap:Header&gt;
  &lt;soap:Body&gt;
    &lt;m:GetFolder&gt;
      &lt;m:FolderShape&gt;
        &lt;t:BaseShape&gt;AllProperties&lt;/t:BaseShape&gt;
      &lt;/m:FolderShape&gt;
      &lt;m:FolderIds&gt;
        &lt;t:DistinguishedFolderId Id=""inbox"" /&gt;
      &lt;/m:FolderIds&gt;
    &lt;/m:GetFolder&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;
</code></pre>

<p>Also, if I instead target the autodiscover URL using <code>exchangelib</code>, I can resolve the server correctly, but still get the same 501 error. So the credentials are correctly configured.</p>

<p>I can provide other information if needed. Any help would be greatly welcome.</p>

<h1>Update 1</h1>

<p>Instead of using the <code>exchangelib</code> module, I was able to correctly authenticate and query the server by splitting up the requests:</p>

<pre><code>session = requests.Session()
session.mount('https://', adapter)
session.headers.update({'Content-Type': 'text/xml; charset=utf-8', 'Expect': '100-continue'})
session.auth = HttpNtlmAuth(domain\\username, password)
session.post('https://SERVICEURL/EWS/Exchange.asmx', verify=False)
session.post('https://SERVICEURL/EWS/Exchange.asmx', data=body, verify=False)
</code></pre>

<p>Here, <code>body</code> is the exact request body <code>excahngelib</code> generated to query the inbox:</p>

<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;
&lt;s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:m=""http://schemas.microsoft.com/exchange/services/2006/messages"" xmlns:t=""http://schemas.microsoft.com/exchange/services/2006/types""&gt;' \
  &lt;s:Header&gt;
    &lt;t:RequestServerVersion Version=""Exchange2013_SP1""/&gt;
    &lt;t:TimeZoneContext&gt;
      &lt;t:TimeZoneDefinition Id=""UTC""/&gt;
    &lt;/t:TimeZoneContext&gt;
  &lt;/s:Header&gt;
  &lt;s:Body&gt;
    &lt;m:GetFolder&gt;
      &lt;m:FolderShape&gt;
        &lt;t:BaseShape&gt;IdOnly&lt;/t:BaseShape&gt;
        &lt;t:AdditionalProperties&gt;
          &lt;t:FieldURI FieldURI=""folder:FolderId""/&gt;
          &lt;t:FieldURI FieldURI=""folder:ChildFolderCount""/&gt;
          &lt;t:FieldURI FieldURI=""folder:EffectiveRights""/&gt;
          &lt;t:FieldURI FieldURI=""folder:FolderClass""/&gt;
          &lt;t:FieldURI FieldURI=""folder:DisplayName""/&gt;
          &lt;t:FieldURI FieldURI=""folder:ParentFolderId""/&gt;
          &lt;t:FieldURI FieldURI=""folder:TotalCount""/&gt;
          &lt;t:FieldURI FieldURI=""folder:UnreadCount""/&gt;
        &lt;/t:AdditionalProperties&gt;
      &lt;/m:FolderShape&gt;
      &lt;m:FolderIds&gt;
        &lt;t:DistinguishedFolderId Id=""root""&gt;
          &lt;t:Mailbox&gt;
            &lt;t:EmailAddress&gt;username@domain&lt;/t:EmailAddress&gt;      
            &lt;t:RoutingType&gt;SMTP&lt;/t:RoutingType&gt; 
            &lt;t:MailboxType&gt;Mailbox&lt;/t:MailboxType&gt;
          &lt;/t:Mailbox&gt;
        &lt;/t:DistinguishedFolderId&gt;
      &lt;/m:FolderIds&gt;
    &lt;/m:GetFolder&gt;
  &lt;/s:Body&gt;
&lt;/s:Envelope&gt;
</code></pre>
",https://stackoverflow.com/questions/62314431/501-invalid-request,"['python', 'soap', 'exchangelib']",269,False,0,0
Start and stop server with supertest,"<p>I have the following server class :</p>

<pre><code>import express, { Request, Response } from 'express';

export default class Server {
  server: any;

  exp: any;

  constructor() {
    this.exp = express();
    this.exp.get('/', (_req: Request, res: Response) =&gt; {
      res.json('works');
    });
  }

  start(): void {
    this.server = this.exp.listen(3000);
  }

  stop(): void {
    this.server.close();
  }
}
</code></pre>

<p>I'm using supertest for end-to-end testing. I wish to start my application beforeAll tests and stop it when the tests are done.</p>

<p>It's easy to do that using beforAll and afterAll where I can just once instanciate the Server class and call the start and close methods.</p>

<p>But as I have 10+ controllers to test, I want to avoid to start and stop the server during each test file.</p>

<p>I found on the documentation the <strong>setupFiles</strong>  and <strong>setupFilesAfterEnv</strong> but I can't stop the server since the instance is not ""shared"" in the two files.</p>

<p>This is an example of 1 test file :</p>

<pre><code>import supertest from 'supertest';

describe('Album Test', () =&gt; {
   let app: App;

   beforeAll(async (done) =&gt; {
     app = new App();

     await app.setUp(); // database connection (not mentionned in the preivous example)
     done();
   });

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

     app.server.stop();
     done();
   });

  const api = supertest('http://localhost:3000');

  it('Hello API Request', async () =&gt; {
    const result = await api.get('/v1/user');
    expect(result.status).toEqual(200);
    ...
  });
});
</code></pre>

<p>This works totally fine but I'm duplicating this  beforeAll and afterAll methods in every test file. Is there a way to declare it only once ?</p>

<p>Thanks</p>
",https://stackoverflow.com/questions/61659975/start-and-stop-server-with-supertest,"['javascript', 'typescript', 'express', 'jestjs', 'supertest']",7124,True,3,2
How to force a test suite to run first and quit entire Jest execution if it fails?,"<p>For my end-to-end testing, I am using Puppeteer with Jest. My codebase is large and I have a lot of tests at the moment. There is one 'preparatory' test suite which checks if there actually is sufficient data on our page for the rest of the tests to proceed. I would like to force this test to run first and then terminate the Jest process if it fails, since there is no need for other tests to run after that.</p>
<p>The <code>--runInBand</code> flag not only has a hard performance hit due to the large number of tsts but also requires manual termination of the Jest process after the failure of the first test, which I have not been able to do.</p>
<p>What is the best way to achieve the above? Could I please get a minimal example of the solution? Thanks!</p>
",https://stackoverflow.com/questions/63305470/how-to-force-a-test-suite-to-run-first-and-quit-entire-jest-execution-if-it-fail,"['javascript', 'testing', 'jestjs', 'puppeteer']",470,True,0,1
Print HTTP response body even if server returns 500,"<p>I run curl in a Jenkins build to make an HTTP call to a servlet application for the purpose of end-to-end testing.</p>
<p>Here is my command:</p>
<pre><code>curl --fail -s -v &lt;target-address&gt;
</code></pre>
<p>The call results in HTTP 500 with a JSON output describing the error cause when I access it with the browser. That is alright.</p>
<p>However, curl indeed shows me only the 500, it suppresses the response payload. This is a problem because  in order to figure out the reason I have to manually reproduce the request through the browser. I would want curl to print the response payload too.
Here is the curl output (some things omitted):</p>
<pre><code>[2020-06-26T09:14:00.433Z] + curl --fail -s -v &lt;target-adddress&gt;
[2020-06-26T09:14:00.433Z] * Expire in 0 ms for 6 (transfer 0x55829a1a6f50)
[2020-06-26T09:14:00.433Z] * Uses proxy env variable no_proxy == 'foobar
[2020-06-26T09:14:00.433Z] * Uses proxy env variable https_proxy == foobar
...
[2020-06-26T09:14:00.433Z] * Expire in 0 ms for 1 (transfer 0x55829a1a6f50)
[2020-06-26T09:14:00.433Z] *   Trying 147.204.6.136...
[2020-06-26T09:14:00.433Z] * TCP_NODELAY set
[2020-06-26T09:14:00.433Z] * Expire in 200 ms for 4 (transfer 0x55829a1a6f50)
[2020-06-26T09:14:00.433Z] &gt; User-Agent: curl/7.64.0
[2020-06-26T09:14:00.433Z] &gt; Proxy-Connection: Keep-Alive
[2020-06-26T09:14:00.433Z] &gt; 
[2020-06-26T09:14:00.433Z] &lt; HTTP/1.1 200 Connection established
[2020-06-26T09:14:00.433Z] &lt; 
[2020-06-26T09:14:00.433Z] * Proxy replied 200 to CONNECT request
[2020-06-26T09:14:00.433Z] * CONNECT phase completed!
[2020-06-26T09:14:00.433Z] * ALPN, offering h2
[2020-06-26T09:14:00.433Z] * ALPN, offering http/1.1
[2020-06-26T09:14:00.433Z] * successfully set certificate verify locations:
[2020-06-26T09:14:00.433Z] *   CAfile: none
[2020-06-26T09:14:00.433Z]   CApath: /etc/ssl/certs
[2020-06-26T09:14:00.433Z] } [5 bytes data]
[2020-06-26T09:14:00.433Z] * TLSv1.3 (OUT), TLS handshake, Client hello (1):
[2020-06-26T09:14:00.433Z] } [512 bytes data]
[2020-06-26T09:14:00.433Z] * CONNECT phase completed!
[2020-06-26T09:14:00.433Z] * CONNECT phase completed!
[2020-06-26T09:14:...
[2020-06-26T09:14:00.433Z] * SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
[2020-06-26T09:14:00.433Z] * ALPN, server did not agree to a protocol
[2020-06-26T09:14:00.433Z] * Server certificate:
[2020-06-26T09:14:00.433Z] * 
[2020-06-26T09:14:00.433Z] } [5 bytes data]
[2020-06-26T09:14:00.433Z] &gt; GET &lt;target-adddress&gt;
[2020-06-26T09:14:00.433Z] &gt; Host: foobar
[2020-06-26T09:14:00.433Z] &gt; User-Agent: curl/7.64.0
[2020-06-26T09:14:00.433Z] &gt; Accept: */*
[2020-06-26T09:14:00.433Z] &gt; 
[2020-06-26T09:14:10.659Z] { [5 bytes data]
[2020-06-26T09:14:10.659Z] * The requested URL returned error: 500 
[2020-06-26T09:14:10.659Z] * Closing connection 0
</code></pre>
<p>How can I parameterize curl to show me the response payload?
BTW, I use <code>--fail</code> to let curl return a return code &lt;&gt; 0 if 500 comes back because I need to react on that case in my Jenkinsfile.</p>
",https://stackoverflow.com/questions/62592894/print-http-response-body-even-if-server-returns-500,['curl'],186,False,0,1
Cypress Login command for IdentityServer and oidc-client-js,"<p>I'm hoping someone can suggest an approach for making a cypress login command, similar to the one in the article below, work with oidc-client-js</p>
<p><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></p>
<p>Normally oidc-client-js saves some state to localstorage with the key oidc:&lt;random_guid&gt; before it redirects to IdentityServer with the sate id in the query params.</p>
<p>It then checks the saved state against the logged in details coming back from the IdentityServer when you call UserManager().signinRedirectCallback() on the callback.html page.</p>
<p>Because my cypress test just posts directly to /connect/token, oidc-client-js doesn't set the initial state and then fails the check when it compares the state returned from IdentityServer in callback.html.</p>
<p>I've tried populating the state manually but I can seem to get the guid that oidc-client-js generates or pass one of my own in.</p>
",https://stackoverflow.com/questions/64106887/cypress-login-command-for-identityserver-and-oidc-client-js,"['identityserver4', 'cypress', 'oidc-client-js']",1019,False,3,0
How InboundPorts in the Hexagonal increase testability,"<p>In Ports and Adapters (Hexagonal) Architecture you have:</p>

<pre><code>DrivingAdapter -&gt; InboundPort &lt;- [ domain ] -&gt; OutboundPort &lt;- DrivenAdapter
</code></pre>

<p><strong><em>note: of course the ports are part of the domain</em></strong></p>

<p>A concrete example of this could be:</p>

<pre><code>WebController -&gt; OrderServicePort [ order domain ] -&gt; OrderRepositoryPort &lt;- MongoDbOrderRepositoryAdapter
</code></pre>

<p>So the idea behind Ports and Adapters Architecture is the you test your domain separately from the concrete adapters at the edges of the application.</p>

<p>What I don't get is how exposing an interface Port on the left side is useful for testability?</p>

<p>WebController has no significant logic so would not be a test target per se and would be tested as part of end to end testing. So I would not mock the OrderServicePort as it normally would be my test subject.</p>

<p>Of course there is value in InboundPorts in that they only expose a simplified view of the concrete domain class that implements it.</p>

<p>But I can't see where the increased testability comes from by using InboundPorts.</p>

<p>Agree?</p>
",https://stackoverflow.com/questions/61483110/how-inboundports-in-the-hexagonal-increase-testability,"['java', 'spring-boot', 'onion-architecture', 'hexagonal-architecture']",398,True,2,2
Handling JSON payload and image data,"<p>I have a standard Controller method to respond to POST requests in the <code>/products</code> route:</p>
<pre class=""lang-java prettyprint-override""><code>@PostMapping(value = &quot;/products&quot;)
public ResponseEntity&lt;ResponseMessage&gt; postProduct(@RequestBody ProductUpsertRequestBody postRequest)
{
   .
   .
   .
</code></pre>
<p><code>ProductUpsertRequestBody</code> is just a simple class that I use to capture the JSON payload:</p>
<pre class=""lang-java prettyprint-override""><code>public class ProductUpsertRequestBody implements Serializable
{
    @JsonProperty(&quot;id&quot;) private String clientProductId;          
    @JsonProperty(&quot;product_name&quot;)  private String productName;
    @JsonProperty(&quot;product_type&quot;) private String productType;
    @JsonProperty(&quot;cost_in_cents&quot;) private Long costInCents;
    @JsonProperty(&quot;description&quot;)  private String description;
    @JsonProperty(&quot;label_color&quot;) private String labelColor;
    .
    .
    .
</code></pre>
<p>I need to expand my controller method with a <code>MultiPartFile</code> argument, transforming it into:</p>
<pre class=""lang-java prettyprint-override""><code>    @PostMapping(value = &quot;/products&quot;)
    public ResponseEntity&lt;ResponseMessage&gt; postProduct(@RequestBody ProductUpsertRequestBody postRequest, @RequestParam MultiPartFile myImage)
    {
      .
      .
      .
    
</code></pre>
<p>But I'm confused as to how this controller method will even be called. It's not hard to make a rudimentary frontend with an HTML form that uploads as many images as I like, but then I lose the capacity to send a JSON payload (it's a REST API, and I'm sending it requests through Swagger 2.9, Postman, effectively <code>curl</code> calls). How can I combine binary image uploading with a JSON payload, such that my controller can capture it? Perhaps exactly as importantly, is there a way for me to do this via Swagger or Postman, so that I can do end-to-end testing of my API?</p>
",https://stackoverflow.com/questions/65346891/handling-json-payload-and-image-data,"['java', 'json', 'spring-boot', 'rest', 'multipart']",272,True,1,1
Cypress browser refreshes browser on changing test file,"<p>I am using Cypress for end to end testing, and I would like to be able to see all run test suites, in the browser, even after they are run. Currently, after each test suite is completed (test which are stored in separate files), the browser reloads and I cannot see previously run tests, and after the final test suite, the browser closes. Is there an option to change this behavior so that I can run all test files, have all the results visible in the browser and that the browser doesn't close at the end?</p>

<p>I am currently running tests using this command: ./node_modules/.bin/cypress run --headed --spec 'cypress/integration/tests/*'
where /tests is the folder where I currently have my files.</p>

<p>I have added --no-exit but in this case cypress doesn't move to the next test file and only the first one runs.</p>
",https://stackoverflow.com/questions/59844275/cypress-browser-refreshes-browser-on-changing-test-file,['cypress'],359,False,0,2
Nuxt end to end testing with jest,"<p>Hello im searching for a way to use component testing as well as end to end testing with nuxt.</p>
<p>we want to be able to test components (which already works) and also check if pages parse their url parameters correctly or sitemaps are correctly created and other page level features and router functions</p>
<p>i tried ava but we already implemented the component testing with jest which works fine now and in the nuxt docs the server rendering for testing was described with ava and i adapted that to jest now but i get timeout errors so i increased the time out to 40 seconds but still get a timeout.</p>
<p>did anybody get the testing to work with the nuxt builder like in the example (<a href=""https://nuxtjs.org/guide/development-tools"" rel=""nofollow noreferrer"">https://nuxtjs.org/guide/development-tools</a>)?</p>
<p>this is my end to end test example file</p>
<pre class=""lang-js prettyprint-override""><code>// test.spec.js:
const { resolve } = require('path')
const { Nuxt, Builder } = require('nuxt')

// We keep the nuxt and server instance
// So we can close them at the end of the test
let nuxt = null

// Init Nuxt.js and create a server listening on localhost:4000
beforeAll(async (done) =&gt; {
  jest.setTimeout(40000)

  const config = {
    dev: false,
    rootDir: resolve(__dirname, '../..'),
    telemetry: false,
  }
  nuxt = new Nuxt(config)
  try {
    await new Builder(nuxt).build()
    nuxt.server.listen(4000, 'localhost')
  } catch (e) {
    console.log(e)
  }

  done()
}, 30000)
describe('testing nuxt', () =&gt; {
  // Example of testing only generated html
  test('Route / exits and render HTML', async (t, done) =&gt; {
    const context = {}
    const { html } = await nuxt.server.renderRoute('/', context)
    t.true(html.includes('&lt;h1 class=&quot;red&quot;&gt;Hello world!&lt;/h1&gt;'))
    jest.setTimeout(30000)
    done()
  })
})
// Close server and ask nuxt to stop listening to file changes
afterAll((t) =&gt; {
  nuxt.close()
})

</code></pre>
<p>my current error is :</p>
<pre><code> ● Test suite failed to run

    Timeout - Async callback was not invoked within the 40000ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 40000ms timeout specified by jest.setTimeout.
</code></pre>
<p>any info is very appreciated as i could not resolve this issue myself</p>
",https://stackoverflow.com/questions/64065988/nuxt-end-to-end-testing-with-jest,"['testing', 'jestjs', 'nuxt.js']",478,False,3,0
Live debug .net core microservice in visual studio that’s hosted locally in kubernetes on docker desktop,"<p>I have set up a simple kubernetes environment on my PC using docker desktop and have a basic ingress controller. </p>

<p>I would like to live debug an Asp.Net Core web api microservice in visual studio that receives a call through the ingress controller so I can do an end to end testing from my front-end.</p>

<p>I can’t find any information on whether this is possible or how other people setup their dev testing environment. So far I have tried using an ExternalService in kubernetes but can’t get it to work with localhost and tried to create a redirect from the ingress controller that just forwards calls on from a certain path but again couldn’t find an approach that worked for me either.</p>

<p>If anyone could tell me if the approaches I am taking work and how to do it or if there is another approach I’m missing, I’d much appreciate it</p>
",https://stackoverflow.com/questions/59924563/live-debug-net-core-microservice-in-visual-studio-that-s-hosted-locally-in-kube,"['visual-studio', 'debugging', 'kubernetes', 'asp.net-core-webapi', 'docker-desktop']",323,False,2,0
Spring boot docker application end-to-end Testing with chrome driver,"<p>I already have Unit and Integration tests with maven but I'm trying to move end-to-end testing with angular(frontend) to maven so I can have every layer of the testing pyramid connected within the same maven build but i'm having trouble doing so.</p>
<p>My spring boot application has some dependencies like postgres and keycloak. I was trying to &quot;mock&quot; does dependencies (in unit and integration tests i use postgres with testcontainers) so i can have an isolated environment without depending on external services are running or not.</p>
<p>I managed to open chrome and do some clicks with selenium and chrome driver but all of this is running on my local database and frontend application which i need to have it up and running. I want something that i can integrate with jenkins later on so i need something to work isolated.</p>
<p>I searched on the internet but i could't find any scenario like this. Anyone could help?</p>
",https://stackoverflow.com/questions/63052014/spring-boot-docker-application-end-to-end-testing-with-chrome-driver,"['java', 'spring', 'maven', 'selenium-chromedriver', 'end-to-end']",541,False,1,1
Test with same action but different contexts,"<p>I'm working in a company as a QA intern, we do end to end testing with browser automation.</p>
<p>We have lots of tests scenarios that looks like that : (we use cucumber)</p>
<pre><code>Given I am logged in
When I go to my address book
Then I can see my contacts
</code></pre>
<p>but recently we had few bugs depending on what kind of account we are logged in so in order to tests this edges case I'm thinking of doing something like that:</p>
<pre><code>Given I am logged in as with in as a project manager
When I go to my address book
Then I can see my contacts
</code></pre>
<p>And do that for every kind of account (project manager, commercial, etc ...)</p>
<p>But I'm asking about the interest of doing that .. For every user the outcome should be the same, they should all see their contacts. (even if due to a bug it was not the case)
if I start doing that way, I would be legit to have test like</p>
<pre><code>Given I am logged in with a german account 
</code></pre>
<p>and same with french, english etc...</p>
<p>but it would lead to an explosion of the number of tests</p>
<p>So do you guys test those edge case ?<br />
If yes, how to do it efficiently ?</p>
",https://stackoverflow.com/questions/64591932/test-with-same-action-but-different-contexts,"['testing', 'automated-tests', 'e2e-testing', 'browser-automation']",29,True,1,2
How to send parameters to a fixture method,"<p>I am new to end-to-end testing. I decided to use pytest and fixtures, but I have a problem in giving parameters to my fixture method. I have a method called authorize, where I push an api key and a password and it returns base64 authorization, which I use in my get method. Also, if the api key and the pass are not given in the authorize method, it prints a message that asks the user to input them manually. The problem is that when I try to push the api key and the pass directly to authorization like this -&gt; authorization(&quot;MyApiKey&quot;,&quot;Test123&quot;), the program gives an error</p>
<blockquote>
<p>Fixture &quot;authorization&quot; called directly. Fixtures are not meant to be
called directly, but are created automatically when test functions
request them as parameters.</p>
</blockquote>
<p>When I do the following <em>my_auth = authorization, &quot;MyAPIKey&quot;, &quot;Test123&quot;</em> an error does not occur, but unfortunately it doesn't take these parameters and wants me to enter new data manually. How can I solve this problem?</p>
<pre><code>@pytest.fixture(scope=&quot;class&quot;)
def authorization(API_KEY=&quot;&quot;, password=&quot;&quot;):
    if API_KEY and password:
        user_data = authorize(API_KEY, password)
    else:
        user_data = authorize()
    return user_data
</code></pre>
<h2></h2>
<pre><code>class Test_create_fixture():
@pytest.mark.usefixtures(name=['authorization'])
    def test_get_empl(self, authorization):
        my_auth = authorization, &quot;MyAPIKey&quot;, &quot;Test123&quot;
        response = get('https://w3schools.com', my_auth)
        assert response.status_code == 200
</code></pre>
",https://stackoverflow.com/questions/65408930/how-to-send-parameters-to-a-fixture-method,"['python', 'python-3.x', 'e2e-testing', 'fixtures']",188,True,0,1
E2E Testing using cypress - Azure AD Single Sign On,"<p>I have been trying to achieve end to end testing using cypress in my angular project and is stuck with a single sign-on issue. Please help me with possible approaches.</p>

<p>Briefing:
My Angular application uses Azure AD Microsoft login to authenticate users to use the application. Is there a way to handle this sign on using cypress or is there a way to bypass
sign on completely.</p>

<p>I have already tried the following blogs and still stuck:
<a href=""https://www.eliostruyf.com/cypress-test-sharepoint-solution-azure-ad-secured-api/"" rel=""nofollow noreferrer"">https://www.eliostruyf.com/cypress-test-sharepoint-solution-azure-ad-secured-api/</a>  
<a href=""https://www.techtonic.com/resources/blog/puppeteer-can-fill-in-cypress-gaps"" rel=""nofollow noreferrer"">https://www.techtonic.com/resources/blog/puppeteer-can-fill-in-cypress-gaps</a>  
<a href=""https://docs.cypress.io/guides/references/best-practices.html#Visiting-external-sites"" rel=""nofollow noreferrer"">https://docs.cypress.io/guides/references/best-practices.html#Visiting-external-sites</a>  
<a href=""https://docs.cypress.io/examples/examples/recipes.html#Single-Sign-On"" rel=""nofollow noreferrer"">https://docs.cypress.io/examples/examples/recipes.html#Single-Sign-On</a> </p>

<p>Whenever I use Cypress to navigate to any page in my app(apart from login), it's getting redirected back to the login giving 401.
Is there any solution to bypass the complete login process and continue E2E testing of the whole app using cypress?
If not, how to handle azure AD single sign-on testing with cypress or any other technology? </p>
",https://stackoverflow.com/questions/61899300/e2e-testing-using-cypress-azure-ad-single-sign-on,"['single-sign-on', 'cypress', 'e2e-testing', 'angular-e2e']",938,False,4,0
Cypress.io Identity Server,"<p>We have a React application protected by a separate Identity Server site. When unauthenticated, the user is redirected to the login page within Identity Server and then on successful login they are then redirected to a callback URL within the React application.</p>

<p>I'm trying to automate this process as much as possible to improve the speed and reliability of our Cypress.io tests so that we don't need to login via the UI each time - allowing the tests to be atomic and free of unnecessary complexity.</p>

<p>What would be the best way to achieve this?</p>

<p>I've followed the examples the Cypress team give around logging in, but haven't been able to get it close to optimal:
<a href=""https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/logging-in__single-sign-on"" rel=""nofollow noreferrer"">https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/logging-in__single-sign-on</a></p>

<p>The closest I've come so far is by following this Auth0 article, but fell short of populating the id_token, nonce and state values to pass to the callback URL:
<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></p>

<p>Any direction greatly appreciated.</p>
",https://stackoverflow.com/questions/62182770/cypress-io-identity-server,"['reactjs', 'identityserver4', 'cypress']",2033,True,4,1
Integrate Cypress with Robot Testing Framework?,"<p>I need to evaluate the best suitable end-to-end-testing library for our React Web App. One requirement would be to integrate this e2e-library with the Robot Framework, that our team currently uses for our tests.</p>
<p>Does anyone know if and how one could integrate Cypress as an e2e-library with the Robot Framework?</p>
<p>UPDATE: Possible scenario could be:
With a simple one line command we would like to execute all our Robot tests and aggregate them in one results file. It would be nice, if there is a way to write Cypress e2e tests inside a robot file, as you can with Selenium, or at least trigger the cypress JS test files and retrieve their results and somehow merge them with the results from the other Robot tests</p>
<p>UPDATE 2: We switched to using the new Robot Library &quot;<strong>Browser</strong>&quot;, which is like Robot Selenium just better in every way. Browser uses the Browser Automation Tool Playwright, the spiritual successor of Puppeteer, under the hood. Working with Browser makes a lot of fun, its API is very intuitive, versatile and potent. So at the moment, we completely dropped the idea of integrating Robot with Cypress. Browser does a wonderful job.</p>
",https://stackoverflow.com/questions/61906938/integrate-cypress-with-robot-testing-framework,"['robotframework', 'cypress']",3951,False,5,0
Passing information from prepare to converge and verify step,"<p>I use <a href=""https://molecule.readthedocs.io"" rel=""nofollow noreferrer"">molecule</a> for end-to-end testing ansible roles that interact with kubernetes clusters.</p>

<p>Due to the fact that spinning up a kubernetes cluster (with additional features I need for my tests) to get a clean environment for each test is very time consuming (up to 45 minutes), I have pre-provisioned a few clusters and created an API which tells me which clusters are available for testing purposes.</p>

<p>In my molecule tests I use the delegated driver with a local connection, so the tests are being run on my local machine or the CI runner.</p>

<p>Now I need to trigger the api, get information on the cluster the tests will be run against and inject those information into each of the molecule steps.</p>

<p>First I though about getting the connection info during the prepare step and making them global somehow (f.e. by defining them as a fact or a host_var), so the converge, verify and cleanup steps can access them.
After research and trying to build a proof-of-concept I suspect that this is not possible. Each molecule step is a new invokation of ansible-playbook, so information can't be passed around.</p>

<p>Am I'm completely missing possibilites molecule is offering? 
Are there any suggestions on how to reach my goal?</p>
",https://stackoverflow.com/questions/60134642/passing-information-from-prepare-to-converge-and-verify-step,"['ansible', 'molecule']",115,False,1,0
FabricJS Inspecting the Canvas from UnitTests or Automated Tools,"<p>We are using FabricJS and items can be rendered to the canvas when actions are taken in the web app.</p>

<p>i.e. Click a button and an object would appear in the fabric canvas.</p>

<p>What are the best methods to check the canvas has been updated correctly using an Automated e2e test?</p>

<p>We are using Puppeteer and/or Protractor for end to end testing.</p>

<p>Is there a good way to check that the canvas contains all of the expected elements?
Are details of the objects in the canvas available to DevTools in any way?</p>

<p>Regards,</p>

<p>Other sources for this problem with no solution.....</p>

<p><a href=""https://www.reddit.com/r/javascript/comments/4ltvfe/are_unit_tests_with_a_fabricjs_app_possible/"" rel=""nofollow noreferrer"">https://www.reddit.com/r/javascript/comments/4ltvfe/are_unit_tests_with_a_fabricjs_app_possible/</a></p>

<p>Here is an example, where Puppeteer can open a FabricJs example page. It is possible to get a screenshot of the whole page, and the dataurl for the canvas. However, it would be better to be able to inspect/follow the canvas state and the objects that it contains together with their locations.</p>

<p><a href=""http://fabricjs.com/static_canvas"" rel=""nofollow noreferrer"">http://fabricjs.com/static_canvas</a></p>

<p>How would you get the location of any of the planets from the example?</p>

<p>The planets are fabric.Circle objects, but rendered to the canvas. Would there be a way to track or follow them?</p>

<pre><code>const puppeteer = require('puppeteer');

(async () =&gt; {
  const browser = await puppeteer.launch({headless:false, args:['--no-sandbox', '--disable-setuid-sandbox']});
  const page = await browser.newPage();

  await page.goto('http://fabricjs.com/solar-system');
  await page.waitFor(4000)
  await page.screenshot({path: 'example.png'});

  const dataUrl = await page.evaluate(() =&gt; {
    const canvas = document.getElementsByClassName(""lower-canvas"")[0];
    console.log(canvas);
    return canvas.toDataURL();
  });

  console.log(dataUrl);
  await page.goto(dataUrl);
  await page.waitFor(4000)
  await browser.close();
})();
</code></pre>

<p>Kind regards,</p>
",https://stackoverflow.com/questions/59977532/fabricjs-inspecting-the-canvas-from-unittests-or-automated-tools,"['javascript', 'protractor', 'fabricjs', 'puppeteer']",484,True,0,1
spring batch junit with multiple datasources. spring data jpa unable to save data in-memory database,"<p>My scenario is that batch job should read data from 1 DB (H2) and dump data into another DB (postgres).Hence I have configured multiple datasources</p>

<p>I have written batch job using spring batch 4.2 and Spring boot 2.2.5.RELEASE. Now I need to write testcase for end to end testing. </p>

<p>I have used custom Batch Configurer using ResourcelessTransactionManager to avoid saving of batch table meta data in in-memory and actual database and it's working. However,I am unable to save business data in H2 in-memory database in junit by calling readerRepository.save(randomReader); and same is working if I replace H2 in-memory database with postgres testconatiner in junit.</p>

<p>Sample junit of repository test</p>

<pre><code>@Slf4j
@SpringBootTest
@Import(LiquibaseConfigReader.class)
class ReaderRepositoryTest {

    @Autowired
    private ReaderRepository readerRepository;

    @BeforeEach
    void setUp() {
        readerRepository.deleteAll();
    }

    @Test
    void shouldFetchAllRecords() {
        var randomReader = RandomDataGenerator.randomReader();
        assertThat(readerRepository.findAll()).hasSize(0);
        readerRepository.save(randomReader);
        assertThat(readerRepository.findAll()).hasSize(1);
    }
}
</code></pre>

<p>I am unable to understand why I am able to save data in postgres test container but not in in-memory H2 database <strong>while running Junit Test</strong>.</p>

<p>To save batch table meta-data in in-memory map, i tried below solutions and now batch table meta data is not being saved anywhere in DB.However, I started facing spring data jpa issue in junit as mentioned above.</p>

<p><a href=""https://stackoverflow.com/questions/49550523/java-spring-batch-using-embedded-database-for-metadata-and-a-second-database"">Java Spring Batch using embedded database for metadata and a second database for other data</a></p>

<p><a href=""https://stackoverflow.com/questions/39913918/spring-boot-spring-batch-without-datasource"">Spring boot + spring batch without DataSource</a></p>

<p><a href=""https://github.com/riversoforion/spring-batch-inmem/blob/master/src/main/java/com/example/batch/CustomBatchConfigurer.java"" rel=""nofollow noreferrer"">https://github.com/riversoforion/spring-batch-inmem/blob/master/src/main/java/com/example/batch/CustomBatchConfigurer.java</a></p>

<p>Is it because of ResourcelessTransactionManager? If yes, how could I avoid saving batch table metadata in any database including in-memory.</p>

<p>I have scrolled through multiple questions given here but none is able to save business data in h2 database.</p>
",https://stackoverflow.com/questions/60825220/spring-batch-junit-with-multiple-datasources-spring-data-jpa-unable-to-save-dat,"['spring-boot', 'spring-data-jpa', 'spring-batch', 'h2', 'junit5']",951,False,1,1
Imported function undefined on first few executions of a Reducer,"<p>I'm really baffled by this odd behaviour. I'm importing a small utility function called <code>now</code>, which is sometimes <code>undefined</code>, and at other points in the execution of my application is working just as it should do.</p>
<p>So here is my <code>now</code> function:</p>
<pre><code>const now = () =&gt; Date.now();

export { now };
</code></pre>
<p>It's super simple and designed to make mocking easier for our end to end testing. Ultimately I want to use this to set the initial state (as you can see by the commented out line below). But for debugging purposes I'm logging from my reducer:</p>
<pre><code>import { now } from '../../../utils';

/**
 * {
 *     currentDate: 01/01/2020,
 * }
 */
const defaultState = {
    // currentDate: new Date(now()),
};

/**
 * Defines a Reducer to handle schedule changes
 * @param  {Object} state  The current state of the application
 * @param  {Object} action The action and payload that we want to trigger in the reducer
 * @return {Object}        The new state
 */
// eslint-disable-next-line default-param-last
const scheduleReducer = (state = defaultState, action) =&gt; {
    console.log(now);
    switch (action.type) {
        default:
            return state;
    }
};

export { scheduleReducer };
</code></pre>
<p>So here I'd expect <code>now</code> to either log as a function, or if I've got the import path wrong to be <code>undefined</code> (and have linting errors). This is the output I actually get:</p>
<p><a href=""https://i.stack.imgur.com/ELlf9.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/ELlf9.png"" alt=""enter image description here"" /></a></p>
<p>I don't understand how this can be possible, when I'm trying to set it the value within <code>initialState</code> Jest complains that <code>now</code> is undefined too, so there's something really weird going on. Can anyone shed some light on this?</p>
<hr />
<p><strong>UPDATE</strong></p>
<p>So something I didn't mention which I've deemed important is the export from the <code>utils</code> directory which has an <code>index.js</code> file that looks like this:</p>
<pre><code>export * from './request';
export * from './now';
</code></pre>
<p>So we've managed to determine the following. If I log the full contents of the <code>utils</code> import, with the above import style then the import is empty:</p>
<pre><code>import { now } from '../../../utils';
import * as index from '../../../utils';

console.log(index);
console.log(now);
</code></pre>
<p><a href=""https://i.stack.imgur.com/eBkrv.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/eBkrv.png"" alt="""" /></a></p>
<p>If however I change the first import:</p>
<pre><code>import { now } from '../../../utils/now';
import * as index from '../../../utils';

console.log(index);
console.log(now);

</code></pre>
<p><a href=""https://i.stack.imgur.com/es6NG.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/es6NG.png"" alt=""enter image description here"" /></a></p>
<p>I don't understand why this is the case, it obviously works around my problem but I'm still interested to understand why the imports behave this way if anyone understands the reasons behind this?</p>
<p>On closer inspection, some of the imports had &quot;cycles&quot; in them, I'm guessing that this could cause a problem. I don't really know how cycles are processed/handles (or not) during imports.</p>
",https://stackoverflow.com/questions/63031561/imported-function-undefined-on-first-few-executions-of-a-reducer,"['javascript', 'react-native', 'redux']",74,False,3,0
Nativescript appium testing installs old version,"<p>I'm developing a mobile app using nativescript + angular and I'm testing it using Appium. When I run appium end to end tests the the following command it loads a previous build of my application.</p>

<pre><code>tns build android
npm run e2e -- --runType device.samsung
</code></pre>

<p>If I run the app in the emulator with the following command I get the latest changes</p>

<pre><code>tns run android
</code></pre>

<p>Running my e2e after this the app is reverted to an older state.</p>

<p>I've tried uninstalling the app from the emulator, then running my e2e but that fails as there is no application installed. After uninstalling the app I find that I have to use the 'tns run android' command to get the app reinstalled on the device.</p>

<p><strong>Update: Checking install</strong></p>

<p>I've checked my setup by following the guides</p>

<ul>
<li><a href=""https://appium.io/docs/en/about-appium/getting-started/index.html"" rel=""nofollow noreferrer"">https://appium.io/docs/en/about-appium/getting-started/index.html</a></li>
<li><a href=""https://docs.nativescript.org/angular/tooling/testing/end-to-end-testing/overview"" rel=""nofollow noreferrer"">https://docs.nativescript.org/angular/tooling/testing/end-to-end-testing/overview</a></li>
</ul>

<p>I've checked my appium.capabilities.json file</p>

<pre><code>""device.samsung"": {
    ""platformName"": ""Android"",
    ""platformVersion"": ""7.0"",
    ""deviceName"": ""samsung_galaxy_s8"",
    ""avd"": ""samsung_galaxy_s8"",
    ""lt"": 60000,
    ""newCommandTimeout"": 720,
    ""noReset"": true,
    ""fullReset"": false,
    ""app"": """"
},
</code></pre>

<p><strong>Update: try turning devMode off</strong></p>

<p>When running my end to end tests it's saying that devMode is on, but when I try and turn it off it's still saying it's on.</p>

<pre><code>npm run e2e -- --devMode=false --runType device.samsung
</code></pre>

<p><strong>Update: noReset seems to be the problem</strong></p>

<p>The problem is we want to use 'noReset' as we are trying to test the remember me auto login ability and this requires saving information for the application. If this gets reset then it doesn't work and cannot be tested. If we set 'noReset' to true then our tests work but the app is not updated when running e2e it doesn't use the running version either.</p>

<p><strong>Update: Full verbose output</strong></p>

<p>Full verbose output when running end to end tests
<a href=""https://gist.github.com/map7/9de70cb330d8864c58787a251d5ea128"" rel=""nofollow noreferrer"">https://gist.github.com/map7/9de70cb330d8864c58787a251d5ea128</a></p>

<p>When starting the end to end tests I can see that it's loading my app three times. The first two times it's the correct version, the last time it runs the app it's the previous version and this is where it runs the tests.</p>
",https://stackoverflow.com/questions/61473045/nativescript-appium-testing-installs-old-version,"['android', 'angular', 'nativescript', 'appium', 'end-to-end']",175,True,2,1
Cypress - Logout with Firebase SDK not working,"<p>I have an application written in <code>Nuxt.js v.2.14.6</code> and want to use <code>Cypress v.5.4.0</code> for end-to-end testing. I use <code>Firebase SDK v.7.21.1</code> for authentication. I created 2 Cypress commands, one for creating a new user and one for logging a user out.</p>
<p><strong>The setup:</strong></p>
<pre><code>Cypress.Commands.add('register', ({ email, password, username }) =&gt; {
  cy.visit('')
  cy.contains('Sign Up').click()
  cy.url().should('contain', 'sign-up')

  cy.get('input[id=username]').type(username)
  cy.get('input[id=email]').type(email)
  cy.get('input[id=password]').type(password)

  cy.get('input[type=submit]').click()

  cy.contains('Creating your account...')
  cy.location('pathname', { timeout: 20000 }).should('eq', '/')
})
</code></pre>
<p>The user registration in my application is performed on the url <code>/sign-up</code> (Hence the url check in the 3rd line). On successful registration, the user is redirected to the homepage (Hence the location check in the last line).</p>
<pre><code>Cypress.Commands.add('logout', () =&gt; {
  cy.visit('')

  cy.get('[data-cy=nav-profile-dropdown]').click()
  cy.get('[data-cy=nav-sign-out]').click()

  cy.contains('Sign In')
})
</code></pre>
<p>The user can logout via a dropdown in the navbar. The logout is successful, when the dropdown in my navbar disappears and the <code>Sign In</code> button appears (Hence the contains check in the last line).</p>
<p>In my application I further have a plugin <code>authlistener.client.js</code> that is using <code>Firebase SDK</code>'s method <code>onIdTokenChanged</code> to determine a <code>signOut</code> event. The <code>authlistener.client.js</code>looks like this:</p>
<pre><code>export default async function ({ app, store, $sentry }) {
  const isServerAuthenticated = store.getters.IS_AUTHENTICATED

  if (!isServerAuthenticated) {
    try {
      await app.$fireAuth.signOut()
    } catch {}
  }
  app.$fireAuth.onIdTokenChanged(async function (authUser) {
    if (authUser) {
      try {
        await _handleAuthSuccess(authUser)
      } catch (e) {
        await _handleAuthError(e)
      }
    } else {
      await _handleSignOut()
    }
  })

  async function _handleAuthSuccess(authUser) {
    const { claims, token } = await authUser.getIdTokenResult()
    const user = BuildProfile(authUser, claims)

    await store.dispatch('SET_SESSION_COOKIE', token)
    store.commit('SET_USER', user)
  }

  async function _handleSignOut() {
    store.commit('SET_USER', null)
    await store.dispatch('SET_SESSION_COOKIE', null)
  }

  async function _handleAuthError(error) {
    $sentry.captureException(error)
  }
}
</code></pre>
<p>In the template of my navbar, I have a button where the sign out event is triggered.</p>
<pre><code>&lt;button @click=&quot;signOut&quot; role=&quot;menuitem&quot; data-cy=&quot;nav-sign-out&quot;&gt;
 Sign out
&lt;/button&gt;
</code></pre>
<p>The <code>signOut</code> method that is being called looks like this:</p>
<pre><code>signOut() {
  this.$fireAuth.signOut()
  this.view.isUserMenuOpen = false
}
</code></pre>
<p>This method uses the <code>Firebase SDK</code>'s <code>signOut()</code> method that is handled by the <code>authlistener</code> plugin described above.</p>
<p>The process described is working fine, both in production as well as in development via <code>npm run dev</code>.</p>
<p><strong>The problem:</strong>
Cypress is not able to perform the logout correctly. Cypress is able to create a new user with my <code>sign-up</code> page. Cypress can also open the navbar dropdown and click the sign out button. What is failing in Cypress is the actual logout of the user, that is, the user dropdown is not replaced by the sign in button.</p>
<p>Since Firebase is storing auth information in an <code>indexedDb</code>, I compared both the indexed db of my local dev setup and the Cypress environment. Interestingly, there were no user information stored in the Cypress environment after the user creation, but in the local dev setup there were relevant user information stored.</p>
<p><strong>Related problems/solutions</strong>
I found a Github <a href=""https://github.com/cypress-io/cypress/issues/1208"" rel=""nofollow noreferrer"">issue</a> that addresses some problems with Cypress in combination with Firebase indexedDb. Unfortunately the solution of clearing the indexedDB before every test run did not work for me.</p>
",https://stackoverflow.com/questions/64533561/cypress-logout-with-firebase-sdk-not-working,"['javascript', 'firebase', 'vue.js', 'nuxt.js', 'cypress']",326,False,1,0
How would you redirect calls to the top object in Cypress?,"<p>In my application code, there are a lot of calls (like 100+) to the ""top object"" referring to window.top such as <code>top.$(""title"")</code> and so forth. Now, I've run into the problem using Cypress to perform end-to-end testing. When trying to log into the application, there are some calls to <code>top.$(...)</code> but the DevTools shows a <code>Uncaught TypeError: top.$ is not a function</code>. This resulted in my team and I discovering that the ""top"" our application is trying to reach is the Cypress environment itself.</p>

<p>The things I've <strong>tried</strong> before coming here are:</p>

<p>1) Trying to stub the window.top with the window object referencing our app. This resulted in us being told window.top is a read-only object.</p>

<p>2) Researching if Cypress has some kind of configuration that would smartly redirect calls to top in our code to be the top-most environment within our app. We figured we probably weren't the only ones coming across this issue.</p>

<p>If there were articles, I couldn't find any, so I came to ask if there was a way to do that, or if anyone would know of an alternate solution?</p>

<p><strong>Another</strong> solution we considered: Looking into naming window objects so we can reference them by name instead of ""window"" or ""top"". If there isn't a way to do what I'm trying to do through Cypress, I think we're willing to do this as a last resort, but hopefully, we don't have to change that, since we're not sure how much of the app it will break upfront.</p>

<p>@Mikkel Not really sure what code I can provide to be useful, but here's the code that causes Cypress to throw the uncaught exception</p>

<pre><code>if (sample_condition) {
  top.$('title').text(...).find('content') // Our iframe
} else {
  top.$('title').text(page_title)
}
</code></pre>

<p>And there are more instances in our code where we access the top object, but they are generally similar. We found out the root cause of the issue is that within Cypress calls to ""top"" actually interface with Cypress instead of their intended environment which is our app.</p>
",https://stackoverflow.com/questions/59869982/how-would-you-redirect-calls-to-the-top-object-in-cypress,"['testing', 'cypress', 'end-to-end']",406,False,1,1
CMake automatically sets CXX upon first execution,"<p>I have a C++ project where I do not want to specify a ""default"" compiler, since it needs to be compiled with many different compilers in different contexts.  (In unit testing and end-to-end testing, I do test it with a few different compilers.)</p>

<p>I tried to implement this in CMake by requiring that the user set the environment variable <code>CXX</code> before the initial CMake configuration (executing <code>cmake</code>).  (I also have it drop a file to store the value to ensure that any subsequent invocation of <code>make</code> has the same value of <code>CXX</code> set, but that's irrelevant to the rest of the question.)</p>

<p>However, this doesn't actually work.  Here is a minimal example and the execution output.</p>

<p>CMake configuration file:</p>

<pre><code>project(test)

if(DEFINED ENV{CXX})
    message(""\$CXX = ${CXX}"")
else()
    message(SEND_ERROR ""\$CXX must be defined by the user to compile this project."")
endif()

add_executable(test)
</code></pre>

<p>First execution of <code>cmake</code>:</p>

<pre><code>-- The C compiler identification is GNU 4.3.4
-- The CXX compiler identification is GNU 4.3.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
$CXX =
-- Configuring done
CMake Error at CMakeLists.txt:9 (add_executable):
  No SOURCES given to target: test


-- Build files have been written to: /hnfs/torcfs03n06a/vol/ret_users_sasquire/inactive/bugs/cmake
</code></pre>

<p>Second invocation of <code>cmake</code> in the same directory (with no cleanup):</p>

<pre><code>CMake Error at CMakeLists.txt:6 (message):
  $CXX must be defined to compile this project.


-- Configuring incomplete, errors occurred!
</code></pre>

<p>So the test whether <code>CXX</code> is defined is clearly working the <em>second</em> time, but not the first time.</p>

<p>Two questions:</p>

<ol>
<li><p>How <em>should</em> I be implementing this?</p></li>
<li><p>I think that it is a somewhat reasonable behavior for <code>cmake</code> to set <code>CXX</code> internally if it wasn't set by the user, and I suspect that's what's happening in the first case.  But why are the first and second runs different?</p></li>
</ol>

<p>Some comments on item 1:</p>

<ul>
<li><p>There are some obvious things, like introducing my own environment variable that is used to determine the compiler that <code>cmake</code> won't set on its own.  But ideally I would just be able to get CMake to forego defining <code>CXX</code>, for example.  Or perhaps there is functionality along the lines of GNU <code>make</code>'s <a href=""https://www.gnu.org/software/make/manual/html_node/Origin-Function.html"" rel=""nofollow noreferrer"">origin function</a>, which can distinguish between variables set in the environment and variables set by default or in the makefile.</p></li>
<li><p>If the answer is basically ""don't do that"" (i.e. don't make the user define the compiler), then I am not going to consider it a constructive answer.</p></li>
</ul>

<p>Comments on item 2:</p>

<ul>
<li>To me, this looks like a bug in CMake, where it sets <code>CXX</code> while detecting the C++ compiler, and then it does not unset that variable afterwards.  But is there a different way to look at this?  Or is there documentation regarding this?</li>
</ul>
",https://stackoverflow.com/questions/60612296/cmake-automatically-sets-cxx-upon-first-execution,"['cmake', 'environment-variables']",559,True,0,1
How to end to end/integration test a Go app that use a reverse proxy to manage subdomain?,"<p>I have a Go app that use Gin gonic and a Nginx reverse proxy that send trafic to another app on domain.com and send all the  *.domain.com subdomains traffic directly to my go app.</p>
<p>My Go app then has a middleware that will read the hostname that nginx passes to it from Context and allow my handlers to know what subdomain is being request and return the proper data and cookies for said subdomain.</p>
<p>It's a pretty simple setup and it seems to work fine from my test in postman as all my routes are the same across all my subdomains so this way i can only use one router for all of them instead of one router per subodmain.</p>
<p>Now my big problem come when i'm trying to do end to end testing.</p>
<p>I'm setting up my test like this :</p>
<pre><code>  router := initRouter()
  w := httptest.NewRecorder()
  req, _ := http.NewRequest(&quot;POST&quot;, &quot;/api/login&quot;, bytes.NewBuffer(jsonLogin))
  req.Header.Set(&quot;Content-Type&quot;, &quot;application/json&quot;)
  router.ServeHTTP(w, req)
  assert.Equal(t, 200, w.Code)
</code></pre>
<p>with <code>initRouter()</code> returning a gin engine with all my routes and middlewares loaded and the rest as a basic test setup.</p>
<p>Obviously the test will fail as the gin Context won't ever receive a subdomain from context and act as if everything is coming from localhost:8000.</p>
<p>Is there a way to either :</p>
<ul>
<li><p>&quot;Mock&quot; a subdomain so that the router think the call is coming from foo.localhost.com instead of localhost</p>
</li>
<li><p>Setup my test suit so that the test request are routed thought nginx.. i'd prefer solution 1 as this would be a mess to setup / maintain.</p>
</li>
</ul>
<p>Edit :</p>
<p>As per the httptest doc i've tried to hard code  foo.localhost as the param of the NewRequest but it doesn't really behave as i need it to behave :</p>
<blockquote>
<p>NewRequest returns a new incoming server Request, suitable for passing to an http.Handler for testing.</p>
</blockquote>
<blockquote>
<p>The target is the RFC 7230 &quot;request-target&quot;: it may be either a path or an absolute URL. If target is an absolute URL, the host name from the URL is used. Otherwise, &quot;example.com&quot; is used.</p>
</blockquote>
<p>When hardcoding <a href=""http://foo.localhost.com/api/login"" rel=""nofollow noreferrer"">http://foo.localhost.com/api/login</a> or foo.localhost.com/api/login as the request target it directly passes it to my router under &quot;foo.localhost.com/api/login&quot; while nginx would just hit the  /api/login directly and parse from <code>c.Request.Host</code></p>
<p>Edit 2:</p>
<p>I'm currently exploring setting the host manually using :</p>
<p><code>req.Header.Set(&quot;Host&quot;, &quot;foo.localhost&quot;)</code></p>
",https://stackoverflow.com/questions/62753072/how-to-end-to-end-integration-test-a-go-app-that-use-a-reverse-proxy-to-manage-s,"['go', 'nginx', 'testing', 'integration-testing']",725,True,3,1
Logging in on a ASP.NET Core application using AAD &amp; cookies with Cypress,"<p>We've added authentication to a couple of our App Services, which are .NET Core 3.1 applications.</p>
<p>The implementation we have in the <code>Startup</code> class looks pretty much like the following excerpt.</p>
<pre class=""lang-cs prettyprint-override""><code>private void AddAuthorization(IServiceCollection services)
{
    services.AddAuthorization(Policies)
        .AddRazorPages().AddMvcOptions(options =&gt;
        {
            var policy = new AuthorizationPolicyBuilder()
                .RequireAuthenticatedUser()
                .RequireRole(&quot;Reader&quot;)
                .Build();
            options.Filters.Add(new AuthorizeFilter(policy));
        });
    services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
            .AddAzureAD(options =&gt; Configuration.Bind(&quot;AzureAd&quot;, options));

    services.Configure&lt;CookieAuthenticationOptions&gt;(AzureADDefaults.CookieScheme, o =&gt;
    {
        o.Events = new CookieAuthenticationEvents
        {
            OnRedirectToAccessDenied = (ctx) =&gt;
            {
                ctx.Response.StatusCode = 403;
                return Task.CompletedTask;
            }
        };
    });
}
private static void Policies(AuthorizationOptions options)
{
    options.AddPolicy(&quot;Read&quot;, builder =&gt; builder
        .RequireAuthenticatedUser()
        .RequireRole(&quot;Reader&quot;));
    options.AddPolicy(&quot;Write&quot;, builder =&gt; builder
        .RequireAuthenticatedUser()
        .RequireRole(&quot;Writer&quot;));
}
</code></pre>
<p>The relevant details in the <code>appsettings.json</code> look like this:</p>
<pre class=""lang-json prettyprint-override""><code>{
    &quot;AzureAd&quot;: {
        &quot;Instance&quot;: &quot;https://login.microsoftonline.com/&quot;,
        &quot;Domain&quot;: &quot;our-domain.com&quot;,
        &quot;TenantId&quot;: &quot;3da1185c-e3b3-4034-a143-32a81c84ee77&quot;,
        &quot;ClientId&quot;: &quot;acf0f949-2ae4-409c-bc6b-5acf22c7c50c&quot;,
        &quot;CallbackPath&quot;: &quot;/signin-oidc&quot;
        }
}
</code></pre>
<p>As you can see, we're using the default authentication scheme for Azure AD, added a default policy which role users need (<code>Reader</code>), and using cookies to store the user details.<br />
All is working fine with this implementation. Users can log in, make requests, etc.</p>
<p>The thing is. We've also started using Cypress to do end-to-end testing for our applications.<br />
This test suite is working quite nicely when testing a different application, which is a React application interacting with a Web API using the JWT bearer scheme.<br />
When making calls to the backend, the Authorization header is set appropriately.</p>
<p>However, with this 'new' application we're not using JWT bearer tokens, we're using cookies.<br />
Just to prove stuff works we started by logging in via the regular Azure AD views with some test user. This works, but it's a bad practice to do so as we shouldn't invoke the AAD pages and we might get blocked for doing so.
We noticed our test suite isn't very stable at the moment also, because when trying to log in, the password field never shows up when running the suite on our build machine (maybe it got blocked or some other 'smart' algorithm makes this field not visible).</p>
<p>I've read it's recommended to use the ROPC flow when in such a scenario.<br />
Because of this, I checked the option in our App Registration so the ROPC flow can be used. I'm now able to use appropriate AAD endpoints to get a token. This all works fine.</p>
<p>But now for the most important part. What do I need to put in the cookie(s) and which cookies do I need to set?<br />
When logging in as a 'normal' user I see there's the <code>.AspNetCore.AzureADCookie</code>, <code>.AspNetCore.AzureADCookieC1</code>, <code>.AspNetCore.AzureADCookieC2</code> entries with some values, but I'm lost at how to set this using a different flow and haven't got a clue what should go inside them.</p>
<p><a href=""https://i.stack.imgur.com/IYg4g.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/IYg4g.png"" alt=""Cookies in the browser when logging in as a user"" /></a></p>
<p>Does anyone have an idea of how to get Cypress &amp; this Cookie scheme working with AAD?<br />
I've seen some samples for Identity Server &amp; Auth0, which appear to be working much simpler for this kind of scenario.</p>
",https://stackoverflow.com/questions/64680999/logging-in-on-a-asp-net-core-application-using-aad-cookies-with-cypress,"['c#', 'asp.net-core', 'authentication', 'azure-active-directory', 'cypress']",502,False,4,0
What is the difference between Puppeteer and Electron with respect to using it to test client side of an app,"<p>I have been rushing to get my app, a mixture between nodejs server driving an sqlite database and a litElement based client side providing the ui, into a useable state as a beta release.  I achieved that a couple of days ago and now I am (belatedly I know) thinking how to put together a test framework.  However I am really struggling to understand how to best test the client side.  I think its because I am having difficulty understanding conceptually what the two main choices of framework are.  Before I go into more detail, let me explain the structure of the app in top level terms.</p>
<p>At the project root level there are three main directories <code>node_modules</code> which comprises all the modules I've pulled in (including <code>lit-element</code> and <code>web-components-loader</code> which are client side elements - but see below) <code>server</code> which contains all the code for the server side of my application and <code>client</code> which consist of all the code for the client side of my app.  I run <code>rollup</code> ONLY at module install time to &quot;package&quot; lit-element and the directives I use and the web-component-loader and effectively treeshake and copy them to the <code>client/libs</code>.  As a result of this my client is coded to assume the modules are in the libs directory AND I DO NOT NEED OR HAVE any build stage. I guess the root of the client is <code>index.html</code> which pulls in a <code>service-worker.js</code> and <code>main-app.js</code>. <code>main-app</code> is the root of a tree in <code>lit-element</code> based components that make up the entire client app.  Nginx is the web server for all the static files in the client, but also acts as a proxy to pass any urls that start <code>/api</code> to a standard node http web server (not even <code>express</code>, although I do use the <code>router</code>, <code>body-parser</code> and <code>final-handler</code> modules) and these get passed to various api handlers each of which is a separate javascript file - although these can &quot;require&quot; a few common modules that I have written and those in the <code>node_modules</code> directory.</p>
<p>I plan on using <code>jest</code> as a test environment.  For my server I think it is easy.  For each api handler I want to test I can build a test script that &quot;requires&quot; the javascript file I want to test.  I am in two minds about whether to use a sqlite database for testing or mock something - I am leaning towards the former as I am using better-sqlite3 and it is totally synchronous and very fast.  I already have scripts to create empty databases, so I have no worry about test isolation.</p>
<p>Client testing is where I get confused.  I &quot;think&quot; that in essence jest can run tests the same way as for the server, one element at a time.  BUT, these elements and my test scripts are going to need a &quot;web-platform&quot; set of APIs - not least of which is the entire shadow dom and custom components stuff that lit-element uses.  This is where, I think, <code>puppeteer</code> or <code>electron</code> in with there associated jest plugins which can put these platform apis into the test environment. But, and this is the essence of my confusion, puppeteer instructions all start with a something like</p>
<pre><code>const browser = await puppeteer.launch({headless: true});
const page = await browser.newPage()
await page.goto(SOME URL);
</code></pre>
<p>What is this URL? - do I have to also run a server?   I cannot relate this snippet to running a test controlled by jest. All the examples seem to use <code>webpack</code> and <code>typescript</code>, neither of which I know anything about.</p>
<p>The other module I have seen mentioned is <code>electron</code>, in particular this article, which everything else seems to point to (or the same text).</p>
<p><a href=""https://www.ninkovic.dev/blog/2020/testing-web-components-with-jest-and-lit-element"" rel=""nofollow noreferrer"">https://www.ninkovic.dev/blog/2020/testing-web-components-with-jest-and-lit-element</a></p>
<p>From the code snippets in this article it &quot;seems&quot; like it might be what I want, BUT ...
I cannot find very many references to electron other than on its own web site.  Here it is telling you to use electron as a tool to build a cross platform application, but nowhere can I find what it is - it assumes you already know.  I don't want a UI for my unit testing I want it to be headless like in puppeteer.</p>
<p>Hence my confusion and why I am unsure how to achieve what I want.  Can someone give me some pointers as to</p>
<ul>
<li>How can I set up puppeteer to run headless tests without needing a server OR</li>
<li>What exactly is electron (and can I use it to
a) run my tests
b) provide me with tools to examine the dom elements I have created to see I have created the right ones) and how is it different from puppeteer and can I use it to conduct headless tests of my client.</li>
</ul>
<p>UPDATE</p>
<p>I've done some more digging and am beginning to understand the differences.  Let me summarise what I think I have found.</p>
<ul>
<li>Puppeteer is great for end to end testing of your site.  You run the tests by launching the included puppeteer at the home page of your site (or the more likely scenario of a development test site) and programatically pretend to be a user who can click on buttons etc.  You can use various methods, including functions such as <code>document.querySelector()</code> to check your UI has behaved how you think, or you can take screen shots and compare with standardised version. I could possible use it for unit tests, but I would have to run a server, create a test fixture html page for every test and navigate to it.  <code>jest-puppeteer</code> is a package with some of that built in.</li>
<li>Electron is a platform for building apps.  What the url I was referencing was using a test runner app <code>jest-electron</code> built using electron.  So worrying about <code>electron</code> is a red herring, I should be worrying about <code>jest-electron</code>.</li>
</ul>
<p>My main concern right now, I think, is that I need different jest configurations for my three scenarios</p>
<ul>
<li>unit tests on the server</li>
<li>unit tests on the client</li>
<li>end to end testing of the complete app.</li>
</ul>
<p>Given I have only one <code>package.json</code> file and one set of <code>node_modules</code> I need to figure out a way to have three different <code>jest-config.js</code> files.</p>
",https://stackoverflow.com/questions/64079522/what-is-the-difference-between-puppeteer-and-electron-with-respect-to-using-it-t,"['unit-testing', 'jestjs', 'electron', 'puppeteer', 'lit-element']",659,False,1,0
