title,body,link,tags,view_count,is_answered,score,answer_count
Spring microservice end-to-end testing,"<p>I'd like to write a end to end test for a pipeline, built with spring boot. </p>

<p>Consider two microservices A, B where B consumes output from A and produces a RESTful API. They are connected using rabbitmq and rely on an external database.</p>

<p><a href=""https://i.stack.imgur.com/moij3.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/moij3.png"" alt=""System scheme""></a></p>

<p>I would like to achieve something like:</p>

<ol>
<li>Create a new project that includes both microservices</li>
<li>Create a test configuration that configures JPA provider to be an in-memory database</li>
<li>Inject custom MQ into A, B to connect them (rabbitmq is not tightly coupled)</li>
<li>Write tests</li>
</ol>

<p>Essentially replacing the white parts with mocks and testing the coloured parts.</p>

<p>Does this make sense? Test coverage of A and B is not complete and such a test would guarantee that the contract between A and B holds. Are there better ways?</p>
",https://stackoverflow.com/questions/50040460/spring-microservice-end-to-end-testing,"['java', 'spring', 'testing']",8640,TRUE,3,4
Allow permission dialog in Flutter end-to-end testing?,"<p>In Flutter end-to-end testing, a permission is to be allowed during the test. <code>driver.tap(find.text(""ALLOW"")</code> does not work. How to click ""ALLOW"".</p>

<p><a href=""https://i.stack.imgur.com/WgXA4.png"" rel=""noreferrer""><img src=""https://i.stack.imgur.com/WgXA4.png"" alt=""enter image description here""></a></p>
",https://stackoverflow.com/questions/53641294/allow-permission-dialog-in-flutter-end-to-end-testing,"['testing', 'flutter', 'end-to-end']",6700,TRUE,21,4
Handling third-party API requests in End-to-End testing,"<p>I want to test my Rest API with end-to-end tests. As I understand, the difference between integration tests is that we don't do in-memory system configuration, but use real test DB and network requests.</p>

<p>But I can't understand how to handle third-party API requests(like GitHub or Bitbucket API). </p>

<p>Is it a normal practice to create a fake Github account with fake data that would be fetched by my tests ? </p>

<p>And what to do with access tokens, not all services are public and even public services can fail with rate limit.</p>
",https://stackoverflow.com/questions/52626983/handling-third-party-api-requests-in-end-to-end-testing,"['rest', 'api', 'testing', 'e2e-testing']",3727,TRUE,20,2
Nuxt Ava End-to-End Testing Store Configuration,"<p>Given the example official Nuxt end-to-end test <a href=""https://nuxtjs.org/guide/development-tools#end-to-end-testing"" rel=""noreferrer"">example</a> using Ava:</p>

<pre><code>import test from 'ava'
import { Nuxt, Builder } from 'nuxt'
import { resolve } from 'path'

// We keep a reference to Nuxt so we can close
// the server at the end of the test
let nuxt = null

// Init Nuxt.js and start listening on localhost:4000
test.before('Init Nuxt.js', async t =&gt; {
  const rootDir = resolve(__dirname, '..')
  let config = {}
  try { config = require(resolve(rootDir, 'nuxt.config.js')) } catch (e) {}
  config.rootDir = rootDir // project folder
  config.dev = false // production build
  config.mode = 'universal' // Isomorphic application
  nuxt = new Nuxt(config)
  await new Builder(nuxt).build()
  nuxt.listen(4000, 'localhost')
})

// Example of testing only generated html
test('Route / exits and render HTML', async t =&gt; {
  let context = {}
  const { html } = await nuxt.renderRoute('/', context)
  t.true(html.includes('&lt;h1 class=""red""&gt;Hello world!&lt;/h1&gt;'))
})

// Close the Nuxt server
test.after('Closing server', t =&gt; {
  nuxt.close()
})
</code></pre>

<p>How can you use <a href=""https://nuxtjs.org/api/internals-nuxt"" rel=""noreferrer"">Nuxt</a> or <a href=""https://nuxtjs.org/api/internals-builder"" rel=""noreferrer"">Builder</a> to configure/access the applications Vuex <a href=""https://nuxtjs.org/guide/vuex-store#classic-mode"" rel=""noreferrer"">store</a>? The example Vuex store would look like:</p>

<pre><code>import Vuex from ""vuex"";

const createStore = () =&gt; {
  return new Vuex.Store({
    state: () =&gt; ({
      todo: null
    }),
    mutations: {
      receiveTodo(state, todo) {
        state.todo = todo;
      }
    },
    actions: {
      async nuxtServerInit({ commit }, { app }) {
        console.log(app);
        const todo = await app.$axios.$get(
          ""https://jsonplaceholder.typicode.com/todos/1""
        );
        commit(""receiveTodo"", todo);
      }
    }
  });
};

export default createStore;
</code></pre>

<p>Currently trying to run the provided Ava test, leads to an error attempting to access <code>@nuxtjs/axios</code> method $get:</p>

<pre><code>TypeError {
  message: 'Cannot read property \'$get\' of undefined',
}
</code></pre>

<p>I'd be able to mock <code>$get</code> and even <code>$axios</code> available on <code>app</code> in Vuex store method <code>nuxtServerInit</code>, I just need to understand how to access <code>app</code> in the test configuration.</p>

<p>Thank you for any help you can provide.</p>
",https://stackoverflow.com/questions/52745300/nuxt-ava-end-to-end-testing-store-configuration,"['vuejs2', 'vuex', 'nuxt.js', 'ava']",768,TRUE,5,1
Angular 5 - End to End testing with ngModel,"<p>in last week we are trying to add e2e testing to our project, but it seems (after a big research in the web) there is no library that can work with Angular ngModel (version 2+).</p>

<p>what can we do ? is there anything except from protractor, which is not support Angular 2 ngModel and binding ?</p>

<p>html example:
</p>

<p>I need to look for the following model ""data.user.name"".</p>

<p>thanks.</p>
",https://stackoverflow.com/questions/48783639/angular-5-end-to-end-testing-with-ngmodel,"['angular', 'protractor', 'angular5', 'e2e-testing', 'angular2-ngmodel']",910,TRUE,1,1
Bypass passport authentication during end to end testing,"<p>I'm currently testing an internal company app (react-redux-express) and wanted to include some UI tests using Puppeteer (the rest of my tests are build with Jest and Enzyme). When I start a Puppeteer page, the session is not logged in and gets redirected to a Google sign-in page via our passport.js middleware. However, my problem is that sometimes our company specific google log in requires 2-factor authentication and therefore blocks any meaningful UI tests from accessing the actual application. So my question is whether there is a way to use passport middleware to exempt auth for testing only, and if so, is that a wise move to make or will it cause security issues?</p>
",https://stackoverflow.com/questions/52282823/bypass-passport-authentication-during-end-to-end-testing,"['authentication', 'testing', 'passport.js', 'puppeteer', 'gui-testing']",717,TRUE,1,1
Difference between webSite testing and end-to-end testing,"<p>I would like to know the difference between end-to-end and website test in java web application,If we are testing the features of an website then it could be stated as end-to-end test right?</p>

<p>My second question is if i want to do end-to-end test which the best tool ?
selenium or cucumber ?
I am not able to conclude my self which tool to use.My requirement is as follows 
1)Test webapplication automatically by giving the required fields,and also it should interact with my service and database for retrieving information  in my UI.
Please help me.I am sorry if its a stupid question !!!</p>
",https://stackoverflow.com/questions/48119164/difference-between-website-testing-and-end-to-end-testing,"['selenium', 'testing', 'cucumber', 'end-to-end']",123,TRUE,0,2
Apache Flink - End to End testing how to terminate input source,"<p>I've used apache flink in batch processing for a while but now we want to convert this batch job to a streaming job. The problem I run into is how to run end-to-end tests.</p>

<p><strong>How it worked in a batch job</strong></p>

<p>When using batch processing we created end-to-end tests using cucumber. </p>

<ul>
<li>We would fill up the hbase table we read from</li>
<li>Run the batch job</li>
<li>Wait for it to finish</li>
<li>verify the result</li>
</ul>

<p><strong>The problem in a streaming job</strong></p>

<p>We would like to do something similar with the streaming job except the streaming job does not really finish.</p>

<p>So:</p>

<ul>
<li>fill up the message queue we read from</li>
<li>Run the streaming job. </li>
<li><strong>Wait for it to finish (how?)</strong></li>
<li>Verify the result</li>
</ul>

<p>We could just wait 5 seconds after every test and assume everything has been processed but that would slow everything down a lot.</p>

<p><strong>Question:</strong></p>

<p>What are some ways or best practices to run end-to-end tests on a streaming flink job without forceable terminating the flink job after x seconds</p>
",https://stackoverflow.com/questions/51242886/apache-flink-end-to-end-testing-how-to-terminate-input-source,"['integration-testing', 'apache-flink', 'flink-streaming', 'end-to-end', 'data-stream']",3304,TRUE,4,1
How do I do integration testing and end to end testing?,"<p>We recently started TDD approach in our .NET project and we have done good unit testing so far but we are stuck with the question of integration and end to end tests. Say I have three objects whose constructors are as following</p>

<pre><code>constructor(kafka, sql, filesystem); // MOQ all the three
constructor(mongo, webservice, kafka); // MOQ all the three
constructor(googlemaps, sql); // MOQ all the two
</code></pre>

<p>Here we have 6 external components to be integrated into our application. We can do unit testing for the three objects by mocking all their dependencies in constructor injection and We can also do end to end testing by having real time set up for all the 6 external components.</p>

<p>My question is how do we deal with integration testing? does Integration testing deal with object testing? I believe unit testing deals with object testing, so integration must deal with external component testing. If we want to write integrate testing, How do I go with?</p>

<pre><code>// Setup kafka real and other objects must still be mocked
constructor(kafka, sql, filesystem); MOQ sql, filesystem but kafka is real
constructor(mongo, webservice, kafka); MOQ mongo, webservice but kafka is real
constructor(googlemaps, sql); MOQ all the two   
</code></pre>

<p>Write tests by making kafka component as real setup and all other objects as mocked. If we go this way, we end up with repetitive code similar to Unit test but instead of mock objects, we typically end up with real environment setup but the test cases will still be same right?</p>

<p>Can we just have unit tests and end to end tests only? because end to end test does integration test for all objects at once. If end to end tests does all the real time objects testing then why does we still do integration tests? What are some best practices for doing integration tests. When we should we go with doing integration tests. Any help is greatly appreciated.</p>
",https://stackoverflow.com/questions/48308908/how-do-i-do-integration-testing-and-end-to-end-testing,"['c#', 'unit-testing', 'testing', 'tdd', 'integration-testing']",4914,TRUE,0,1
End to end Testing / Run Selenium IDE .json file using webdriver node.js,"<p>I have installed <code>Selenium extension</code> of google Chrome <a href=""https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd"" rel=""nofollow noreferrer"">Selenium IDE</a>, so I can record my tests and save the test file as <code>.side</code> which is a <code>json</code> file. It contains</p>
<p><code>{id , command , target , value}</code> .</p>
<pre><code>{     &quot;id&quot;: &quot;70a08bcc-b351-4ec6-b64d-f833f09adfa2&quot;,
      &quot;name&quot;: &quot;Untitled Project&quot;,
      &quot;url&quot;: &quot;http://example.io&quot;,
      &quot;tests&quot;: [
        {
          &quot;id&quot;: &quot;0b5184ff-4873-459b-b55b-77d56ebf5f6e&quot;,
          &quot;name&quot;: &quot;Untitled&quot;,
          &quot;commands&quot;: [
            {
              &quot;id&quot;: &quot;35b40ae7-1ada-46d9-8c65-d8faaf1af753&quot;,
              &quot;command&quot;: &quot;open&quot;,
              &quot;target&quot;: &quot;/&quot;,
              &quot;value&quot;: &quot;&quot;
            },
            {
              &quot;id&quot;: &quot;0e0bd8b3-4301-4ac6-8cd6-4b01fa94f68d&quot;,
              &quot;command&quot;: &quot;type&quot;,
              &quot;target&quot;: &quot;name=login&quot;,
              &quot;value&quot;: &quot;test@tets.io&quot;
            },
            {
              &quot;id&quot;: &quot;078da69d-eec3-44b8-b793-53b401a18ac4&quot;,
              &quot;command&quot;: &quot;clickAt&quot;,
              &quot;target&quot;: &quot;//div[@id='cloud-ui']/div/div[3]/div/button/span&quot;,
              &quot;value&quot;: &quot;24,17&quot;
            }...
      
</code></pre>
<p>I would like to know if there is solution to run the test file automatically using <code>JavaScript</code>, for example a plugin that reads the file and execute the commands ?</p>
<p>If no, what about create my own JavaScript function that fetch the JSON objects <code>{id, command, target, value}</code>  and execute the commands?</p>
<p>for example:</p>
<pre><code>   {
      &quot;id&quot;: &quot;512a84b8-c3b0-4cb6-88b4-025d28502f1f&quot;,
      &quot;command&quot;: &quot;clickAt&quot;,
      &quot;target&quot;: &quot;css=li.active &gt; a&quot;,
      &quot;value&quot;: &quot;18,62&quot;
    }
</code></pre>
<p>we can run it using <code>selenium-webdriver</code></p>
<pre><code>  driver.findElement(By.css(&quot;li &gt; a &gt; span&quot;)).click();
</code></pre>
",https://stackoverflow.com/questions/48902171/end-to-end-testing-run-selenium-ide-json-file-using-webdriver-node-js,"['node.js', 'selenium-webdriver', 'end-to-end', 'selenium-server']",3731,FALSE,4,0
SimpleInjector: End-to-end testing of controller&#39;s methods on a test database,"<p>I have a web app with several REST API controllers. This controllers got injected repositories as per <a href=""https://learn.microsoft.com/en-us/aspnet/web-api/overview/testing-and-debugging/unit-testing-controllers-in-web-api#testing-actions-that-return-httpresponsemessage"" rel=""nofollow noreferrer"">this tutorial</a> using SimpleInjector. I'd like to add some end-to-end testing to my project to make sure controller's method calls affect database in predictable manner (I'm using EF6, MySQL, code first). I was going to use <a href=""https://stackoverflow.com/a/40949708/2782477"">this plan</a> to test my app. I like overall approach but it seems like in this approach author is feeding db context directly into controller. In my case I have a Controller that gets an injected Repository from constructor and in turn Repositiry gets injected DbContext. Obviously I can hardcode the chain of creating DbContext, instantiating Repository followed by instantiating a Controller but it kinda defies the purpose of using the SimpleInjector, isn't it? I think there should be the way do it in more transparrent manner.</p>

<p>Basically I would like to inject separate database into my tests. When server is running it's using one database, when tests are running they are using the other ad-hoc database.</p>

<p>I have my test classes in a separate project, so I will need a way to instantiate my Controllers and Repositories from the main project. I'm not sure how I can do it either. Is it a good idea to expose my <code>SimpleInjector.Container</code> from another project somehow?</p>

<p>Additional info: I'm using .Net Framework (non-Core), I would like to manage withouth mocking for now unless it's required.</p>
",https://stackoverflow.com/questions/50839875/simpleinjector-end-to-end-testing-of-controllers-methods-on-a-test-database,"['c#', 'asp.net', 'asp.net-web-api', 'simple-injector']",136,TRUE,2,2
Nuxt.js end to end testing errors after following documentation also using nuxt-auth,"<p>Edit: Reduced test case <a href=""https://github.com/mkstix6/nuxt-e2e-testing-auth-bug"" rel=""nofollow noreferrer"">https://github.com/mkstix6/nuxt-e2e-testing-auth-bug</a></p>

<hr>

<p>I'm following the nuxt.js e2e testing documentation here:</p>

<p><a href=""https://nuxtjs.org/guide/development-tools#end-to-end-testing"" rel=""nofollow noreferrer"">https://nuxtjs.org/guide/development-tools#end-to-end-testing</a></p>

<p>I am also using the nuxt-auth module (<a href=""https://auth.nuxtjs.org"" rel=""nofollow noreferrer"">https://auth.nuxtjs.org</a>)</p>

<p>When I follow the documentation and run <code>npm test</code> I get errors.</p>

<p>The first few lines are [edit: expanded this a bit]:</p>

<pre><code>Entrypoint app = 7e99177222eb06aee534.js f26c11108ae3834e1137.js 3e276f5900ac5332c193.js
[12:04:56 PM] Compiling server
[12:05:01 PM] Compiled server in 5s

Hash: 944950bfae0ad00400a8
Version: webpack 4.20.2
Time: 4945ms
Built at: 10/16/2018 12:05:01 PM
             Asset     Size  Chunks             Chunk Names
server-bundle.json  995 KiB          [emitted]
Entrypoint app = server-bundle.js
[Vue warn]: Property or method ""$auth"" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based comp
onents, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

found in

---&gt; &lt;Default&gt; at default.vue
       &lt;Root&gt;
[Vue warn]: Error in render: ""TypeError: Cannot read property '$state' of undefined""

found in

---&gt; &lt;Default&gt; at default.vue
       &lt;Root&gt;
[Vue warn]: Property or method ""$auth"" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based comp
onents, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

found in

---&gt; &lt;Default&gt; at default.vue
       &lt;Root&gt;
[Vue warn]: Error in render: ""TypeError: Cannot read property '$state' of undefined""

found in

---&gt; &lt;Default&gt; at default.vue
       &lt;Root&gt;
[12:05:02 PM] TypeError: Cannot read property '$state' of undefined
at Proxy.defaultvue_type_template_id_706d1520_render (server-bundle.js:2010:28)
at VueComponent.Vue._render (/PROJECT_PATH/node_modules/vue/dist/vue.runtime.common.js:4542:22)
at renderComponentInner (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:7532:25)
at renderComponent (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:7502:5)
at RenderContext.renderNode (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:7418:5)
at RenderContext.next (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:2436:14)
at cachedWrite (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:2295:9)
at renderElement (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:7656:5)
at renderNode (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:7420:5)
at renderComponentInner (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:7538:3)
at renderComponent (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:7502:5)
at RenderContext.renderNode (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:7418:5)
at RenderContext.next (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:2436:14)
at RenderContext.next (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:2449:12)
at cachedWrite (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:2295:9)
at renderElement (/PROJECT_PATH/node_modules/vue-server-renderer/build.js:7646:5)

  2 failed

  Route / exits and render HTML

  /PROJECT_PATH/server-bundle.js:2010

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'$state\' of undefined',
  }

  Proxy.defaultvue_type_template_id_706d1520_render (server-bundle.js:2010:28)
  VueComponent.Vue._render (node_modules/vue/dist/vue.runtime.common.js:4542:22)
  renderComponentInner (node_modules/vue-server-renderer/build.js:7532:25)
  renderComponent (node_modules/vue-server-renderer/build.js:7502:5)
  RenderContext.renderNode (node_modules/vue-server-renderer/build.js:7418:5)
  RenderContext.next (node_modules/vue-server-renderer/build.js:2436:14)
  cachedWrite (node_modules/vue-server-renderer/build.js:2295:9)
  renderElement (node_modules/vue-server-renderer/build.js:7656:5)
  renderNode (node_modules/vue-server-renderer/build.js:7420:5)
  renderComponentInner (node_modules/vue-server-renderer/build.js:7538:3)
  renderComponent (node_modules/vue-server-renderer/build.js:7502:5)
  RenderContext.renderNode (node_modules/vue-server-renderer/build.js:7418:5)
  RenderContext.next (node_modules/vue-server-renderer/build.js:2436:14)
  RenderContext.next (node_modules/vue-server-renderer/build.js:2449:12)
  cachedWrite (node_modules/vue-server-renderer/build.js:2295:9)
  renderElement (node_modules/vue-server-renderer/build.js:7646:5)



  Route / exits and render HTML with CSS applied

  /PROJECT_PATH/node_modules/request-promise-core/lib/errors.js:32

  Rejected promise returned by test. Reason:

  StatusCodeError {
    error: Buffer @Uint8Array [
</code></pre>

<p>I have tried the advice in the ""Declaring Reactive Properties"" page – as hinted to in the error – but I'm quite new to nuxt.js and vue.js; I may have gotten it wrong.</p>

<p>I'm looking for some advice on how to move past these errors.</p>

<p>Thanks for reading.</p>
",https://stackoverflow.com/questions/52783787/nuxt-js-end-to-end-testing-errors-after-following-documentation-also-using-nuxt,"['e2e-testing', 'nuxt.js']",987,FALSE,1,0
What is the difference between black box testing and end-to-end testing?,"<p>Both of them check the application from the user's point of view, so, what it's the difference between them?</p>
",https://stackoverflow.com/questions/52865313/what-is-the-difference-between-black-box-testing-and-end-to-end-testing,"['testing', 'end-to-end', 'black-box-testing']",1750,TRUE,1,3
end to end testing :- Protractor error : unknown error: call function result missing &#39;value&#39;,"<p>here is the code in page object. </p>

<pre><code> getPageTitle () {
return browser.getTitle (); 
}
</code></pre>

<p>And in my script i have wrote down this code. : </p>

<pre><code>it('Title should be Project', () =&gt; {

    page.navigateTo();
    page.getPageTitle()
      .then((title: string) =&gt; {
        expect(title).toEqual('Project');
      });
  });
</code></pre>

<p>After that, i am getting this error. I have no idea why i am having this, while my title is written properly. </p>

<pre><code>    1) project App Title should be Project
  - Failed: unknown error: call function result missing 'value'
  (Session info: chrome=66.0.3359.181)
  (Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.13.0-41-generic x86_64)

Executed 1 of 1 spec (1 FAILED) in 0.699 sec.
[11:55:50] I/launcher - 0 instance(s) of WebDriver still running
[11:55:50] I/launcher - chrome #01 failed 1 test(s)
[11:55:50] I/launcher - overall: 1 failed spec(s)
[11:55:50] E/launcher - Process exited with error code 1

(node:26179) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@0.0.0 e2e: `protractor ""./protractor.conf.js""`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project@0.0.0 e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/student-08/.npm/_logs/2018-05-23T09_55_51_005Z-debug.log

Some end-to-end tests failed, see above.
</code></pre>

<p>I also tried with this : </p>

<pre><code>it('Title should be Project', () =&gt; {
page.navigateTo();
expect(page.getPageTitle()).toEqual('Project');
 })
</code></pre>

<p>But still having the same problem.
Any idea what have i done wrong ?</p>
",https://stackoverflow.com/questions/50485330/end-to-end-testing-protractor-error-unknown-error-call-function-result-mis,"['protractor', 'angular5', 'e2e-testing']",311,FALSE,0,1
Can i use cypress.io for end to end testing with jest instead of mocha?,"<p>I really like the end to end testing of cypress.io.</p>

<p>However, I use jest. I would like to use jest instead of mocha. Can i use cypress io with jest instead of mocha?</p>
",https://stackoverflow.com/questions/51956601/can-i-use-cypress-io-for-end-to-end-testing-with-jest-instead-of-mocha,['cypress'],2538,TRUE,3,1
How can I automate the end-to-end testing of my serverless web app?,"<p>So my app stack looks like this in prod:</p>

<ul>
<li>Backend:        AWS API Gateway + Lambda + DynamoDB + ElastiCache(redis)</li>
<li>Backend - algo: Long running process - dockerized Java app running on ECS (Fargate)</li>
<li>Frontend:       Angular app, served from S3</li>
</ul>

<p>I'd like to use <a href=""https://www.cypress.io/"" rel=""nofollow noreferrer"">https://www.cypress.io/</a> for end-to-end testing and I'd like to use <a href=""https://circleci.com/"" rel=""nofollow noreferrer"">https://circleci.com/</a> for my build server.</p>

<p>How do I go about creating an environment to allow the end-to-end tests to run?</p>

<p>Options:</p>

<p>1) Use Terraform to script the infrastructure and create/tear down a whole environment every time we run the end-to-end tests. This sounds like a huge overhead in terms of spin up time. Also the environment creation and setup being fully scripted sounds like a lot of work!</p>

<p>2) Create a dedicated, long lived environment that we deploy to incrementally. This sounds like it'll get messy - not ideal for a place to run tests.</p>

<p>3) Make it so we can run the environment locally. So perhaps use use AWS's <a href=""https://docs.aws.amazon.com/lambda/latest/dg/test-sam-cli.html"" rel=""nofollow noreferrer"">SAM</a> or something like this project <a href=""https://github.com/gertjvr/serverless-plugin-simulate"" rel=""nofollow noreferrer"">https://github.com/gertjvr/serverless-plugin-simulate</a></p>

<p>That last option may also answer the question of the local dev environment setup however everything that mocks serverless tech locally seems to be in beta and I'm concerned that if I go down that road I might hit some issues after investing a lot of time....</p>
",https://stackoverflow.com/questions/52419088/how-can-i-automate-the-end-to-end-testing-of-my-serverless-web-app,"['amazon-web-services', 'aws-lambda', 'aws-api-gateway', 'serverless', 'aws-serverless']",4185,TRUE,3,4
"How to test an Angular JS UI App, end to end testing using Mocha framework","<p>I need to perform end to end test for Node.js front end Application developed using AngularJs 4. Currently we are using Mocha framework for Nodejs Rest API services. Can we use Mocha framework for testing Node.js front end Application developed using AngularJs 4??</p>
",https://stackoverflow.com/questions/49402724/how-to-test-an-angular-js-ui-app-end-to-end-testing-using-mocha-framework,"['node.js', 'angular', 'mocha.js', 'angular-e2e']",376,FALSE,0,1
Which is the best way to do end to end testing of Spring Boot Rest APIs?,"<p>I have checked in google and stackoverflow for end to end testing of Spring Boot Rest APIs.</p>

<p>I would like to test  controller -> Service -> Repository at once.</p>

<p>I found two approaches are efficient:</p>

<pre><code>1. TestRestTemplate: 
   Single call to the controller method with in-memory database configuration for repository.
2. MockMvc: 
   Create 2 Test classes. 
   one for Controller-&gt;Service 
   and one for Service-&gt;Repository. 
   Is there any way to club both 2 classes into one class.
</code></pre>

<p>which is the best way to do ""end to end testing"" of Spring Boot Rest APIs from above 2 approaches ???</p>
",https://stackoverflow.com/questions/50879695/which-is-the-best-way-to-do-end-to-end-testing-of-spring-boot-rest-apis,"['spring-boot', 'junit', 'spring-boot-test']",2779,TRUE,2,1
End to End testing in Cucumber or combining test cases to run as an end to end test,"<p>We are using cucumber automate our web-based application and our mobile side application.  We have test cases that enable for us to validate we would have to set it in our website then check mobile application to see if it worked.  Here's the question
- Is it possible in cucumber to combine or reference an existing test cases from another suite to run AFTER say I set a setting in our web portal?
- Example
Test Case 
- Set feature A to On in web portal
- In order for Feature A to be checked it it worked I have to go to Mobile App and check</p>

<p>Is there such a thing as
Execute test case 1 then go to another suite and execute test case 2?
or should we just combine the whole end to end even though test case 2 already exists as an independent test?</p>
",https://stackoverflow.com/questions/53561396/end-to-end-testing-in-cucumber-or-combining-test-cases-to-run-as-an-end-to-end-t,"['ruby', 'cucumber']",46,FALSE,1,0
"What is the difference between unit, integration and end-to-end tests in Angular?","<ol>
<li>What is the difference between Unit, Integration and End-to-end testing in Angular?</li>
<li>Which the principles or paradigms should I know to implement each kind of these tests, how it works?</li>
</ol>
<p>I found out that unit testing is for component class, integration testing is for component's class and template together.</p>
<p>But I didn't find how does end-to-end testing differ from these ones, how can I implement them in Angular, which are the principles and paradigms for these types of testing.</p>
",https://stackoverflow.com/questions/52606199/what-is-the-difference-between-unit-integration-and-end-to-end-tests-in-angular,"['angular', 'testing']",2244,TRUE,4,1
WebDriverError: Cannot define class using reflection,"<p>I am using gulp-angular-protractor for end-to-end testing of my web app. I am getting the following error recently but earlier it used to work perfectly.</p>

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

<p>Any help to fix this issue will be appreciated.</p>

<p>Details:</p>

<pre><code>OS - Ubuntu 16.04,
node - v6.12.2,
npm - v3.10.10,
Vagrant - v1.9.3,
karma - v0.13.22,
gulp-angular-protractor - v1.1.1,
protractor - v5.1.2,
webdriver-manager - v12.0.6
</code></pre>
",https://stackoverflow.com/questions/48113889/webdrivererror-cannot-define-class-using-reflection,"['angularjs', 'selenium-webdriver', 'gulp-protractor']",2099,TRUE,2,1
Pressing Enter with Protractor in Ionic,"<p>I'm trying to test my Ionic App using end to end testing with protractor. I want to test my search input which currently searches when the enter key is pressed. How do I issue an enter command with protractor in Ionic?</p>

<p>I've tried this:</p>

<pre><code>browser.actions().sendKeys(protractor.Key.ENTER).perform();
</code></pre>

<p>But I get:</p>

<pre><code>Cannot find name 'protractor
</code></pre>
",https://stackoverflow.com/questions/49684689/pressing-enter-with-protractor-in-ionic,"['ionic-framework', 'protractor']",47,FALSE,0,0
Testing forms in angular,"<p>I have been unit testing angular forms validation using Jasmine and Karma. Now I want to use protractor and karma for the same thing. To test if the inputs are valid or not (maxlength, required, etc).</p>

<p>Is it possible in protractor, since it is used for end to end testing?</p>

<p>Thanks,</p>
",https://stackoverflow.com/questions/50655360/testing-forms-in-angular,"['javascript', 'html', 'angular', 'unit-testing']",79,TRUE,2,1
End to end test http requests,"<p><strong>What end-to-end testing JavaScript framework is best to test outgoing HTTP requests?</strong></p>

<p>I want to test HTTP request's payloads as well.</p>

<p>I am considering Nightwatch.js, but so far I couldn't figure out if Nightwatch.js allows testing the HTTP request and its payload.</p>

<p>(I am not using AngularJS on my website.)</p>
",https://stackoverflow.com/questions/51391453/end-to-end-test-http-requests,"['testing', 'automated-tests', 'casperjs', 'nightwatch.js', 'end-to-end']",339,TRUE,0,2
Endly error related to ssh,"<p>I using endly for end to end testing and my application is running on docker container, and I am facing this error. I already have my secret keys/folder in place.</p>

<p><code>[run[build]run|build[Init]docker.run ssh: no key found at exec.extract                                           error]
[run[build]run|build[Init]docker.run build_Init: ssh: no key found at docker.run/exec.extract at workflow.run    error]
[run[build]run|build[Init]docker.run build: build_Init: ssh: no key found at docker.run/exec.extract at workflow error]
build: build_Init: ssh: no key found at docker.run/exec.extract at workflow.run at workflow.run
[run[build]run|build[Init]docker.run run_init: build: build_Init: ssh: no key found at docker.run/exec.extract a error]</code></p>

<p>I followed the steps mentioned in github.com/viant/endly/tree/master/doc/secrets link. The contents of my localhost.json is {""Username"":""xxx"",""EncryptedPassword"":""xxx"",""PrivateKeyPath"":""xxx/.ssh/id_rsa.pub""}</p>
",https://stackoverflow.com/questions/50339718/endly-error-related-to-ssh,"['docker', 'end-to-end', 'endly']",55,FALSE,0,1
Outputting value from input field in javascript,"<p>i have a input field where I send an input value:</p>

<pre><code>var firstNumber = element(by.model('first'));    
firstNumber.sendKeys(1);
</code></pre>

<p>I want to write the value of input box ('1') on console. When I use following:</p>

<pre><code>console.log(""Value from input box is: "" + firstNumber.getAttribute('value'));
</code></pre>

<p>I get following answer:</p>

<pre><code>Value from input box is: [object Object]
</code></pre>

<p>How can I get the actual value. </p>

<p>p.s. This may seem very silly question, but I'm absolutely new to javascript, which I'm using in protractor End to end testing using Jasmine framework.</p>
",https://stackoverflow.com/questions/49861097/outputting-value-from-input-field-in-javascript,"['javascript', 'protractor']",45,TRUE,0,1
Android Test Orchestrator is running the BeforeClass Twice if there are two test,"<p>Android Test Orchestrator Runs several times the BeforeClass method. Since I'm using Espresso to do end-to-end testing, I'm calling some APIS to get some users created as a testsetup and they being created for every test, It's slowing down the test execution.</p>

<p>On gradle</p>

<pre><code>testOptions {
    execution 'ANDROID_TEST_ORCHESTRATOR'
}
...
androidTestUtil 'com.android.support.test:orchestrator:1.0.1'



public class LoginTest extends IntegrationTest {
  @Rule
  public ActivityTestRule&lt;LoginActivity&gt; activityTestRule = new ActivityTestRule&lt;LoginActivity&gt;(LoginActivity.class);

  @BeforeClass
  static public void doThisFirstOnlyOnce() {
    Log.d(""Testing_tag"", ""BEFORE CLASS"");
  }

  @Before
  public void doThisFirst() {
    Log.d(""Testing_tag"", ""BEFORE every test"");
  }

  @After
  public void doThisLast() {
    Log.d(""Testing_tag"", ""After every test"");
  }

  @AfterClass
  static public void doThisLastOnlyOnce() {
    Log.d(""Testing_tag"", ""AFTER CLASS"");
  }

  @Test
  public void test1() {
    Log.d(""Testing_tag"", ""Test 1"");
  }

  @Test
  public void test2() {
    Log.d(""Testing_tag"", ""Test 2"");
  }
}
</code></pre>

<p>I uses the same configuration for espresso and the rest.</p>

<p>Results</p>

<pre><code>03-08 13:38:50.978 18756-18782/com.app D/Testing_tag: BEFORE CLASS
03-08 13:38:51.844 18756-18782/com.app D/Testing_tag: BEFORE every test
03-08 13:38:51.844 18756-18782/com.app D/Testing_tag: Test 1
03-08 13:38:51.844 18756-18782/com.app D/Testing_tag: After every test
03-08 13:38:52.141 18756-18782/com.app D/Testing_tag: AFTER CLASS
03-08 13:38:53.503 18825-18851/? D/Testing_tag: BEFORE CLASS
03-08 13:38:54.366 18825-18851/com.app D/Testing_tag: BEFORE every test
03-08 13:38:54.366 18825-18851/com.app D/Testing_tag: Test 2
03-08 13:38:54.366 18825-18851/com.app D/Testing_tag: After every test
03-08 13:38:54.728 18825-18851/com.app D/Testing_tag: AFTER CLASS
</code></pre>

<p>Do you know anyway to fix this?</p>
",https://stackoverflow.com/questions/49173877/android-test-orchestrator-is-running-the-beforeclass-twice-if-there-are-two-test,"['java', 'android', 'android-espresso']",635,TRUE,2,1
Element is not displayed in Internet Explorer using Protractor framework,"<p>I am using protractor framework for end-to-end testing. For browser i need to user Internet explorer. the problem is click is not working in internet explorer. same test case I use for Chromedriver. And it runs perfectly. But whenever I try to run this with internet explorer i got the following error. I saw the elemt is present when direct to the inspect page.</p>

<pre><code>    Failed: Element is not displayed
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'NB132', ip: '10.0.75.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: unknown
WebDriverError: Element is not displayed
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'NB132', ip: '10.0.75.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: unknown
</code></pre>

<p>My configuration for protractor is</p>

<pre><code>multiCapabilities:[
    {
        'browserName': 'internet explorer',
        version:11,
        'se:ieOptions' : {
            nativeEvents: false,
            ignoreZoomSetting: true,
            ignoreProtectedModeSettings: true,
            enablePersistentHover: true,

        },
        unhandledPromptBehavior : 'accept'
    }
    ],

  jvmArgs: ['-Dwebdriver.ie.driver=./node_modules/webdriver-manager/selenium/IEDriverServer3.141.0.exe'],
</code></pre>
",https://stackoverflow.com/questions/53743384/element-is-not-displayed-in-internet-explorer-using-protractor-framework,"['internet-explorer', 'selenium-webdriver', 'webdriver', 'protractor']",129,FALSE,1,0
Using TestCafe with mobx,"<p>I am trying to use <a href=""https://github.com/DevExpress/testcafe"" rel=""nofollow noreferrer"">testCafe</a> and <a href=""https://github.com/DevExpress/testcafe-react-selectors"" rel=""nofollow noreferrer"">testcafe react selectors</a> with my mobx app for end to end testing. React selectors have very convenient selectors. For eg: for components as follows: </p>

<pre><code>&lt;TodoApp className=""todo-app""&gt;
    &lt;TodoInput /&gt;
    &lt;TodoList&gt;
        &lt;TodoItem priority=""High""&gt;Item 1&lt;/TodoItem&gt;
        &lt;TodoItem priority=""Low""&gt;Item 2&lt;/TodoItem&gt;
    &lt;/TodoList&gt;

    &lt;div className=""items-count""&gt;Items count: &lt;span&gt;{this.state.itemCount}&lt;/span&gt;&lt;/div&gt;
&lt;/TodoApp&gt;
</code></pre>

<p>Selecting a component is as easy as: </p>

<p><code>const TodoList = ReactSelector('TodoApp TodoList')</code></p>

<p>But when I am using inject with mobx:</p>

<pre><code>inject((ctx) =&gt; ({
  injectable1: ctx.injectable1,
}))(Component)
</code></pre>

<p>there mobx inserts a decorator component like follows:
<a href=""https://i.stack.imgur.com/cOVed.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/cOVed.png"" alt=""inject""></a></p>

<p>Thus I cannot use normal react selector. Is there some way I can use the react selector without using Html selector?</p>
",https://stackoverflow.com/questions/51288685/using-testcafe-with-mobx,"['testing', 'automated-tests', 'e2e-testing', 'mobx', 'testcafe']",76,TRUE,1,1
Angular Protactor test getting h1 text from html,"<p>I am very new in end to end testing. In my app I have a login page, which I want to show the user when they logout from the app. Now there is a text h1 inside the div. But I am not getting the text from that div and that is why the expected result is different from the actual result. </p>

<p>Here is my login page html. </p>

<pre><code>&lt;div *ngIf=""!isLoggedIn"" class=""login-controller""&gt;


    &lt;div layout=""column"" class=""login-dialog""&gt;

        &lt;h1&gt;Here is a heading&lt;/h1&gt;
        &lt;h2&gt;Second Heading&lt;/h2&gt;
        &lt;div class=""border""&gt;

           ...
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Here is my app.po.ts</p>

<pre><code>    async getLogInPage(){
    return await element(by.css('h1')).getText();
    }

    async logoutOfApplication() {
    var userMenu = element(by.css("".prof-dropbtn &gt; span""));
    browser.wait(ExpectedConditions.presenceOf(userMenu), 10000);
    await userMenu.click();

    var logoutButton = element(by.id(""logout""));
    await logoutButton.click();
  }
</code></pre>

<p>Now app.e2e-spec.ts</p>

<pre><code>    it('Test for logout', () =&gt; {
    page.logoutOfApplication();
    expect(page.getLogInPage()).toEqual('Here is a heading');
    page.loginToApplication(""email.com"", ""demo"");
  });
</code></pre>
",https://stackoverflow.com/questions/51611664/angular-protactor-test-getting-h1-text-from-html,"['html', 'angular', 'selenium', 'protractor', 'end-to-end']",1780,TRUE,1,1
Take screenshot for multiple browser in Allure with Protractor Configuration,"<p>I am very new in end to end testing environment. I am using Protractor framework, jasmine runner for my app testing. I run my test with Chrome and Internet explorer. But in allure report I can see the report only for one browser, not for both. Also screen shot is generated only for one browser. is there any configuration for allure, by which I can see the report for both browser.</p>

<p>My configuration file is </p>

<pre><code>var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
require('protractor/built/logger').Logger.logLevel = 3;
exports.config = {
    troubleshoot: true, // for protractor
    allScriptsTimeout: 1200000,
    specs: [
        './e2e/tests/**/0030*.e2e-spec.ts',
    ],

    multiCapabilities:[
    {
            'browserName' : 'chrome',
            'chromeOptions': { 'args' : ['--disable-extensions']},
            'shardTestFiles': true,
            'maxInstances': 1,
            'unexpectedAlertBehaviour' : 'dismiss'
        },
        {
            'browserName': 'internet explorer',
            'se:ieOptions': {

                enablePersistentHover: true,
                'ie.ensureCleanSession': true,
            }
        }
        ],

      jvmArgs: ['-Dwebdriver.ie.driver=./node_modules/webdriver-manager/selenium/IEDriverServer3.141.0.exe'],


    baseUrl: 'http://localhost:4200/',
    framework: 'jasmine',
    jasmineNodeOpts: {
        isVerbose: true,
        showColors: true,
        defaultTimeoutInterval: 1200000
    },
    useAllAngular2AppRoots: true,
    beforeLaunch: function() {
    }

    onPrepare: function() {
    browser.manage().window().maximize();
    require('ts-node').register({
        project: 'e2e/tsconfig.json'
    });

    jasmine.getEnv().addReporter(reporter);

    var AllureReporter = require('jasmine-allure-reporter');

    capsPromise.then(function(caps) {
        console.log(caps);
        var browserName = caps.get('browserName');
        var browserVersion = caps.get('version');
        const prePendStr = browserName + ""-"" + browserVersion + ""-"";
        console.log(prePendStr);
    });

    jasmine.getEnv().addReporter(new AllureReporter({
        resultsDir: 'allure-results'
    }));
    jasmine.getEnv().addReporter(reporter);

    jasmine.getEnv().afterEach(function (done) {
            browser.takeScreenshot().then(function (png) {
                allure.createAttachment('Screenshot', function () {
                    return new Buffer(png, 'base64')
                },'image/png')();
                done();
            })
    });

    jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
        //savePath: './test/jasmine-nowshin/'
    }));
  }
};
</code></pre>

<p><strong>Updated code in test</strong></p>

<pre><code>    let capsPromise = browser.getCapabilities();
let browserNameforSpec;
capsPromise.then(function(caps) {
    console.log(caps);
    let browserName = caps.get('browserName');
    let browserVersion = caps.get('version');
    browserNameforSpec = browserName + '-' + browserVersion + '-';
    console.log(browserNameforSpec);

});

describe( '0030 Test for login' + browserNameforSpec, function () { // this.browserNameforSpec value is undefined

    // 1.
    it('Navigate to the login page', async () =&gt; {
        await navigate.to.the(loginPage);
    });

    // 2
    it('Click onto language button', async() =&gt; {
        await click.onto(languageButton);
        await expect(languageDropdown.isDisplayed());
    });

    // 3
    it('English Language is selected', async() =&gt; {    
        await click.onto(englishLanguage);
        await expect(languageButton.getText()).toBe('English');
    });

    // 4.
    it('Correct user name is written into email field', async() =&gt; {
        await usernameField.click();
        await enter(correctUsername, into(usernameField));    
    });

    // 5.
    it('Correct password is written into password field', async() =&gt; {
            await passwordField.click().then(function () {
                passwordField.clear();
                enter(correctPassword, into(passwordField));
            })    
    });

    // 6.
    it('Login button is clicked and home page is opened', async() =&gt; {
        await click.onto(loginButton);
    });    
});
</code></pre>
",https://stackoverflow.com/questions/53813441/take-screenshot-for-multiple-browser-in-allure-with-protractor-configuration,"['javascript', 'angularjs', 'jasmine', 'protractor', 'allure']",1265,TRUE,1,1
Jest Mockgoose Doc.save() doesn&#39;t work async/await,"<p>I'm using jest on my e-commerce software so I can also do render tests when end-to-end testing (themes are supported, that's why).<br>
But I'm currently just testing some mongoose functionality and when I'm trying to save a document, it gives me this error:
<code>Error: Timeout - Async callback was not invoked within the 10000ms timeout specified by jest.setTimeout.</code></p>

<p>I noticed it doesn't give that error when I remove the lines with <code>await doc.save();</code>.
So I think it has something to do with async/await, but I can't find it.</p>

<p>package.json</p>

<pre><code>""jest"": {
  ""automock"": false,
  ""moduleDirectories"": [
    ""node_modules""
  ],
  ""testPathIgnorePatterns"": [
    ""node_modules"",
    "".idea"",
    ""public""
  ],
  ""collectCoverage"": true,
  ""coverageThreshold"": {
    ""global"": {
      ""branches"": 5,
      ""lines"": 40,
      ""functions"": 25,
      ""statements"": -1000
    }
  },
  ""setupTestFrameworkScriptFile"": ""./setupJest.js"",
  ""coverageDirectory"": ""coverage"",
  ""globalSetup"": ""./globalSetupJest.js""
}
</code></pre>

<p>globalSetupJest.js</p>

<pre><code>const Mongoose = require('mongoose').Mongoose;
const mongoose = new Mongoose();

const Mockgoose = require('mockgoose').Mockgoose;
const mockgoose = new Mockgoose(mongoose);
const {promisify} = require('util');

module.exports = async () =&gt; {
    try {

        await mockgoose.prepareStorage();
        promisify(mongoose.connect);

        await mongoose.connect('mongodb://localhost/test')

        mongoose.connection.on('connected', () =&gt; {
            console.log('db connection is now open');
        });

    } catch (e) {
        console.log('error in setting up mockgoose', e);
    }
};
</code></pre>

<p>Product.test.js  </p>

<pre><code>describe('Product', () =&gt; {
    const index = require('./index');
    const productSchema = require('./model');

    const Product = mongoose.model(index.modelName, productSchema);

    describe('Instance Functionality', () =&gt; {
        let baseProductObj;
        let localProduct;

        beforeEach(async () =&gt; {
            baseProductObj = {
                ean: 123456789,
                title: 'Test product',
                description: 'Test description',
                stock: {
                    amount: 5,
                    track: true
                },
                pricing: {
                    cost: 5,
                    price: 10
                },
                url: 'test-product'
            };
            localProduct = new Product(baseProductObj);
            try {
                return await localProduct.save();
            } catch (e) {
                console.log('error in beforeEach', e);
            }
        });

        describe('.reduceStock', () =&gt; {
            test('Should decrease the stock by a default of 1', async () =&gt; {
                try {
                    localProduct.reduceStock();
                    await localProduct.save();
                } catch (e) {
                    console.log('error in saving localProduct', e);
                }
                expect(localProduct.stock.amount).toEqual(4);
            });
        });
    });
});
</code></pre>
",https://stackoverflow.com/questions/51331620/jest-mockgoose-doc-save-doesnt-work-async-await,"['javascript', 'node.js', 'mongoose', 'jestjs', 'mockgoose']",563,FALSE,0,2
&quot;ReferenceError: device is not defined&quot; when using detox+Jest in React Native for android,"<p>App is working fine both in Android and iOS simulators. I am trying to setup Detox with Jest for end to end testing my react-native app. In simulator I can see some movement but app is not launched and I get following errors(apart from ""device not defined"" I am also getting ""app-debug-androidTest.apk: No such file or directory"" error, so not sure what is the root cause here).</p>

<p><strong>Console</strong></p>

<pre><code>&gt;detox test --configuration android.emu.debug
node_modules/.bin/jest e2e --config=e2e/config.json --runInBand 
 server listening on localhost:64281...
(node:75639) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
  console.log e2e/firstTest.spec.js:3
    **********before each called

  console.log e2e/firstTest.spec.js:9
    ***************first test

 FAIL  e2e/firstTest.spec.js (123.358s)
  Example
    ✕ should have welcome screen (120009ms)

  ● Example › should have welcome screen

    ChildProcessError: Command failed: /Users/xxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/xxx/Projects/xxxxxx/android/app/build/outputs/apk/app-debug-androidTest.apk
    adb: failed to stat /Users/xxx/Projects/xxxxxx/android/app/build/outputs/apk/app-debug-androidTest.apk: No such file or directory
     `/Users/xxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/xxx/Projects/xxxxxx/android/app/build/outputs/apk/app-debug-androidTest.apk` (exited with error code 1)

      at callback (../node_modules/child-process-promise/lib/index.js:33:27)

  ● Example › should have welcome screen

    ReferenceError: device is not defined

      2 |   beforeEach(async () =&gt; {
      3 |     console.log('**********before each called');
    &gt; 4 |     await device.reloadReactNative();
      5 |     console.log('**********before each end');
      6 |   });
      7 |   

      at Object._callee$ (firstTest.spec.js:4:1)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at invoke (../node_modules/regenerator-runtime/runtime.js:152:20)
      at ../node_modules/regenerator-runtime/runtime.js:195:11
      at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:194:16)
      at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:217:13)
      at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at Object.&lt;anonymous&gt;.runtime.async (../node_modules/regenerator-runtime/runtime.js:241:14)
      at Object._callee (firstTest.spec.js:2:57)

  ● Example › should have welcome screen

    Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.

      at ../node_modules/jest-jasmine2/build/queue_runner.js:72:21
      at Timeout.callback [as _onTimeout] (../node_modules/jsdom/lib/jsdom/browser/Window.js:592:19)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        123.919s, estimated 241s
Ran all test suites matching /e2e/i.
child_process.js:644
    throw err;
    ^

Error: Command failed: node_modules/.bin/jest e2e --config=e2e/config.json --runInBand 
    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at runJest (/Users/xxx/Projects/xxxxxx/node_modules/detox/local-cli/detox-test.js:69:6)
    at Object.&lt;anonymous&gt; (/Users/xxx/Projects/xxxxxx/node_modules/detox/local-cli/detox-test.js:42:5)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
</code></pre>

<p>firstTest.spec.js:</p>

<pre><code>describe('Example', () =&gt; {
  beforeEach(async () =&gt; {
    console.log('**********before each called');
    await device.reloadReactNative();
    console.log('**********before each end');
  });

  it('should have welcome screen', async () =&gt; {
    console.log('***************first test');
    await expect(element(by.id('welcome'))).toBeVisible();
    console.log('***************first test end');
  });
})
</code></pre>

<p><strong>package.json</strong></p>

<pre><code>""dependencies"": {
    ""react"": ""16.0.0"",
    ""react-native"": ""0.51.0"",
    .... 
  },
  ""devDependencies"": {
    ""babel-jest"": ""22.0.3"",
    ""babel-preset-react-native"": ""4.0.0"",
    ""detox"": ""^6.0.4"",
    ""jest"": ""22.0.3"",
    ""react-test-renderer"": ""16.0.0""
  },
  ""jest"": {
    ""preset"": ""react-native"",
    ""setupTestFrameworkScriptFile"": ""./e2e/init.js""
  },
  ""detox"": {
    ""specs"": ""e2e"",
    ""test-runner"": ""jest"",
    ""runner-config"": ""e2e/config.json"",
    ""configurations"": {
      ""android.emu.debug"": {
        ""binaryPath"": ""android/app/build/outputs/apk/app-debug.apk"",
        ""build"": ""pushd android &amp;&amp; ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug &amp;&amp; popd"",
        ""type"": ""android.emulator"",
        ""name"": ""Pixel_API_27""
      },
      ""android.emu.release"": {
        ""binaryPath"": ""android/app/build/outputs/apk/release/app-release.apk"",
        ""build"": ""cd android &amp;&amp; ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release &amp;&amp; cd .."",
        ""type"": ""android.emulator"",
        ""name"": ""Pixel_API_27""
      }
    }
  }
</code></pre>

<p><strong>init.js</strong></p>

<pre><code>const detox = require('detox');
const config = require('../package.json').detox;

// Set the default timeout
jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000;

beforeAll(async () =&gt; {
  await detox.init(config);
});

afterAll(async () =&gt; {
  await detox.cleanup();
});
</code></pre>

<p>Following is the view while running the test command
<a href=""https://i.stack.imgur.com/Omo1t.jpg"" rel=""noreferrer""><img src=""https://i.stack.imgur.com/Omo1t.jpg"" alt=""Emulator while running test""></a></p>
",https://stackoverflow.com/questions/48148064/referenceerror-device-is-not-defined-when-using-detoxjest-in-react-native-fo,"['react-native', 'detox']",4931,TRUE,5,1
Login to google programmatically with organisation account for cypress end-to-end test,"<p>At my organisation, I am trying to set up end-to-end testing with cypress on a testing environment that simulate the real website with copy of the real data.
I currently have trouble to login on the website since we uses google sign on with our organisation email (name@organisation.com). I cannot access google's login form with cypress google doesn't allow bot to login. </p>

<p>Is there a way to login to google with organisation account programmatically with cypress to get a valid token ?  </p>
",https://stackoverflow.com/questions/53716673/login-to-google-programmatically-with-organisation-account-for-cypress-end-to-en,"['javascript', 'google-api', 'integration-testing', 'cypress']",1701,FALSE,3,0
How to reuse puppeteer tests,"<p>I'm currently working with Puppeteer and Jest for end-to-end testing, for my tests to work I always need to run a login tests, but I don't know and haven't been able to find out how to export my tests so I can reuse them.</p>

<p>To conclude: I'm looking for a way to reuse all of my tests inside the describe by exporting them to a different file and reusing them in a beforeAll in the new files.</p>

<p>The complete set of login tests is below:</p>

<pre><code>describe(""homepage and login tests"", homepageTests = () =&gt; {

    test(""front page loads"", async (done) =&gt; {
        await thePage.goto('http://localhost:3000');
        expect(thePage).toBeDefined();
        done();
    });

    test(""Login button is present"", async (done) =&gt; {
        theLoginButton = await thePage.$(""#login-button"");
        expect(theLoginButton).toBeDefined();
        done();
    })

    test(""Login works"", async (done) =&gt; {
        //the following code runs inside the popup
        await theBrowser.on('targetcreated', async (target) =&gt; {
            const thePopupPage = await target.page();
            if (thePopupPage === null) return;

            //get the input fields
            const usernameField = await thePopupPage.waitFor('input[name=login]');
            const passwordField = await thePopupPage.waitFor(""input[name=password]"");
            const submitButton = await thePopupPage.waitFor('input[name=commit]');

            //validate input fields
            expect(usernameField).not.toBeNull();
            expect(passwordField).not.toBeNull();
            expect(submitButton).not.toBeNull();

            //typing and clicking
            await thePopupPage.waitFor(300)
            await usernameField.type(""USER"");
            await passwordField.type(""PASSWORD"");
            await submitButton.click();
            done();
        })

        try {
            //wait for login button on homepage
            theLoginButton = await thePage.waitFor('#login-button');
            expect(theLoginButton).toBeDefined();

            //click on login
            await thePage.waitFor(200);
            await theLoginButton.click();

        } catch (e) { console.log(e) }
    })

    test(""Arrive on new page after login"", async () =&gt; {
        //resultsButton is only shown for logged in users.
        const resultsButton = await thePage.$(""#resultsButton"");
        expect(resultsButton).toBeDefined();
    })
</code></pre>
",https://stackoverflow.com/questions/50755896/how-to-reuse-puppeteer-tests,"['testing', 'jestjs', 'puppeteer', 'end-to-end']",679,FALSE,2,1
Setting default download directory and headless chrome,"<p>I have a rails app, and am running capybara &amp; selenium, and using chrome for end-to-end testing. I want to set the default download directory while running chrome headless.</p>

<p>Here's how I have it setup in my support/env.rb:</p>

<pre><code>Capybara.register_driver :chrome do |app|
  Capybara::Selenium::Driver.new(app, :browser =&gt; :chrome)
end

Capybara.register_driver :headless_chrome do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
  'chromeOptions' =&gt;  {
    'args' =&gt; %w(headless disable-gpu window-size=1920,1080),
    'prefs' =&gt; {
      'download.default_directory' =&gt; DownloadHelpers::PATH.to_s
    }
  }
)
Capybara::Selenium::Driver.new app,
  browser: :chrome,
  #args: [""--window-size=1024,768""], #UNCOMMENT TO HAVE BROWSER WINDOW POP UP
  desired_capabilities: capabilities
end
</code></pre>

<p>I have noticed that if I leave off </p>

<pre><code>'args' =&gt; %w(headless disable-gpu window-size=1920,1080)
</code></pre>

<p>Then the default download directory is set, however, the browser automatically pops up, which I want to disable.</p>

<p>When I have both:</p>

<pre><code>    'args' =&gt; %w(headless disable-gpu window-size=1920,1080),
'prefs' =&gt; {
  'download.default_directory' =&gt; DownloadHelpers::PATH.to_s
}
</code></pre>

<p>It runs headless, but the default download path is not set.</p>

<p>I have the following versions:</p>

<p>capybara   (2.14.2)</p>

<p>selenium-webdriver   (3.6.0) </p>

<p>chromedriver-helper   (1.1.0) </p>
",https://stackoverflow.com/questions/48810757/setting-default-download-directory-and-headless-chrome,"['ruby-on-rails', 'ruby', 'selenium', 'selenium-chromedriver']",4737,TRUE,3,2
Recreate Azure SQL Database before E2E test,"<p>I have an application with an Azure SQL Server. I have a test environment where I deploy the app for end to end testing. I want to reset the database to a certain state before the tests. I have a bacpac file with that state. My goal is to do this with a ci tool (appveyor). I am aware that I can drop the entire database with azure powershell api. Should I drop the database or should I empty it? Or am I thinking this totally wrong?</p>
",https://stackoverflow.com/questions/50086475/recreate-azure-sql-database-before-e2e-test,"['powershell', 'azure-sql-database', 'end-to-end', 'appveyor']",252,TRUE,0,2
Unable to create new service InternetExplorerDriverService uing Protractor Jasmine,"<p>I know it might be common issue. But I just stuck with this issue for last 2 days. I want to run the end-to end testing with protractor framework using Internet explorer browser. I followed all the steps from this link
<a href=""https://stackoverflow.com/questions/48993206/protractor-with-ie-on-windows-10-fails-error-code-199"">Protractor with IE on Windows 10 fails - error code 199</a></p>

<p>But again I got this error while trying to run the test. I would be happy if someone give me good advise for this problem.</p>

<p>The error message</p>

<pre><code> Debugger attached.
[14:03:47] E/launcher - Unable to create new service: InternetExplorerDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'NB132', ip: '10.0.75.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: unknown
[14:03:47] E/launcher - SessionNotCreatedError: Unable to create new service: InternetExplorerDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'NB132', ip: '10.0.75.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: unknown
    at Object.checkLegacyResponse (---\node_modules\selenium-webdriver\lib\error.js:546:15)
    at parseHttpResponse (--\node_modules\selenium-webdriver\lib\http.js:509:13)
    at doSend.then.response (---\node_modules\selenium-webdriver\lib\http.js:441:30)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
From: Task: WebDriver.createSession()
    at Function.createSession (C:\Users\--\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
    at createDriver (C:\Users\--\node_modules\selenium-webdriver\index.js:170:33)
Waiting for the debugger to disconnect...
    at Builder.build (C:\Users\--\node_modules\selenium-webdriver\index.js:635:14)
    at Local.getNewDriver (C:\Users\---\node_modules\protractor\built\driverProviders\driverProvider.js:53:33)
    at Runner.createBrowser (C:\Users\--\node_modules\protractor\built\runner.js:195:43)
    at q.then.then (C:\Users\--\node_modules\protractor\built\runner.js:339:29)
    at _fulfilled (C:\Users\--\node_modules\q\q.js:834:54)
    at C:\Users\--\node_modules\q\q.js:863:30
    at Promise.promise.promiseDispatch (C:\Users\---node_modules\q\q.js:796:13)
    at C:\Users\--\node_modules\q\q.js:604:44
    at runSingle (C:\Users\---\node_modules\q\q.js:137:13)
    at flush (C:\Users\---\node_modules\q\q.js:125:13)
    at process.internalTickCallback (internal/process/next_tick.js:70:11)
[14:03:47] E/launcher - Process exited with error code 199

Process finished with exit code 199
</code></pre>

<p>and the configuration file</p>

<pre><code>    const JasmineConsoleReporter = require('jasmine-console-reporter');
const reporter = new JasmineConsoleReporter({
    colors: 1,           // (0|false)|(1|true)|2
    cleanStack: 1,       // (0|false)|(1|true)|2|3
    verbosity: 4,        // (0|false)|1|2|(3|true)|4|Object
    listStyle: 'indent', // ""flat""|""indent""
    timeUnit: 'ms',      // ""ms""|""ns""|""s""
    timeThreshold: { ok: 500, warn: 1000, ouch: 3000 }, // Object|Number
    activity: false,     // boolean or string (""dots""|""star""|""flip""|""bouncingBar""|...)
    emoji: true,
    beep: true
});

exports.config = {
    allScriptsTimeout: 110000000,
    specs: [
        './e2e/tests/**/0300*.e2e-spec.ts',
    ],
    multiCapabilities:[
        {
            'browserName': 'internet explorer',
        },
        ],

    directConnect: false,
    baseUrl: '--------'
    framework: 'jasmine',
    jasmineNodeOpts: {
        isVerbose: true,
        showColors: true,
        defaultTimeoutInterval: 50000000
    },
    useAllAngular2AppRoots: true,
    beforeLaunch: function() {

    },
    onPrepare: function() {

        require('ts-node').register({
            project: 'e2e/tsconfig.json'
        });

        jasmine.getEnv().addReporter(reporter);

        var AllureReporter = require('jasmine-allure-reporter');
        jasmine.getEnv().addReporter(new AllureReporter({
            resultsDir: 'allure-results'
        }));
        jasmine.getEnv().afterEach(function(done){
            browser.takeScreenshot().then(function (png) {
                allure.createAttachment('Screenshot', function () {
                    return new Buffer(png, 'base64')
                }, 'image/png')();
                done();
            })
        });

        jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
            savePath: './test/jasmine/'
        }));
    }
};
</code></pre>
",https://stackoverflow.com/questions/53724964/unable-to-create-new-service-internetexplorerdriverservice-uing-protractor-jasmi,"['javascript', 'protractor', 'internet-explorer-11', 'end-to-end']",1312,FALSE,0,0
Detox mocking using file extension e2e.js,"<p>I'm using Detox as an end to end testing framework for a react native application. I'd like to mock the results of API requests in order to reduce flakiness and time for testing.</p>

<p>According to the <a href=""https://github.com/wix/detox/blob/master/docs/Guide.Mocking.md"" rel=""nofollow noreferrer"">documentation</a>, I should be able to have Metro overwrite a module using the file extension e2e.js.</p>

<p>I'm unable to get this working and I'm not entirely sure why. Most documentation and existing questions relate to using react-native-repackager, but as of RN 0.55.0, this is no longer needed.</p>

<p>Any help/ideas would be appreciated!</p>

<p>EDIT: </p>

<p><code>RN_SRC_EXT=e2e.js react-native start</code> works fine</p>

<p><code>RN_SRC_EXT=e2e.js xcodebuild -project &lt;other params&gt;</code> as the detox build script and <code>detox test -c ios.sim.release</code> does not work </p>
",https://stackoverflow.com/questions/50032008/detox-mocking-using-file-extension-e2e-js,"['node.js', 'react-native', 'detox']",1981,TRUE,3,2
npm update only changed dependencies of a dependency,"<p>Is there a way to update dependencies of a dependency A (without reinstalling the dependency A package)?</p>

<p>I'm trying to create a faster workflow and have a script that copies over all of the <code>dist/</code> folder and <code>package.json</code> file of some packages I'm working on to an example project for end to end testing, however that script does not update any nested dependencies and I'm looking for a way to update those.</p>

<p>I've tried solutions like 'verdaccio' but I'm looking to speed things up a lot but not uploading and reinstalling the whole group of packages every time I want to test something.</p>
",https://stackoverflow.com/questions/51971680/npm-update-only-changed-dependencies-of-a-dependency,"['node.js', 'npm', 'lerna']",157,FALSE,0,0
Integrating UFT 14.0 &amp; Selenium Automation test cases,"<p>We have 2 clinical applications one is a patient administration created in Oracle forms and another clinical application which is a Java based application. We are in the process of automating the applications to do end to end testing. we have been able to automate the Oracle forms application part in UFT 14.0 and we have been able to automate the Java side in selenium both of these in isolation of each other. </p>

<p>Is there anyway of integrating UFT &amp; Selenium so that we can complete end to end automation testing, so that when we have completed the UFT testing it then goes onto complete the selenium test cases.</p>
",https://stackoverflow.com/questions/53101818/integrating-uft-14-0-selenium-automation-test-cases,"['oracle', 'selenium', 'automation', 'automated-tests', 'hp-uft']",1074,TRUE,2,2
how to use route test kit to test routes,"<p>Hi I want to perform end to end testing I have a play application in Which I have controllers I want to test the routes with Akka route test kit 
I am following this link </p>

<p><a href=""https://doc.akka.io/docs/akka-http/current/routing-dsl/testkit.html"" rel=""nofollow noreferrer"">https://doc.akka.io/docs/akka-http/current/routing-dsl/testkit.html</a></p>

<p>I want to ask how can I test this route with akka http route test kit</p>

<pre><code>POST    /getuserid                  controllers.UserController.getUserID()
</code></pre>

<p>here is the Action method </p>

<pre><code>class UserController extends Controller {
def getUserID = Action { implicit request =&gt;
    var jsonResponse = Json.obj()
      var jsonRequest = request.body.asJson.get
      val id = (jsonRequest \ ""uuid"").as[String]
      Ok(""id is ""+id)
  }
}
</code></pre>

<p>here in the link its written </p>

<blockquote>
  <p>ROUTE is an expression evaluating to a Route. You can specify one inline or simply refer to the route structure defined in your service.</p>
</blockquote>

<p>how can I achieve -> simply refer to the route structure defined in your service 
Please help</p>
",https://stackoverflow.com/questions/48112276/how-to-use-route-test-kit-to-test-routes,"['java', 'scala', 'playframework', 'akka', 'akka-http']",291,FALSE,0,1
Trigger change event for React rendered input (type=range),"<p>""react"": ""^15.4.2""</p>

<p>I am having trouble triggering the change event from jquery for an input rendered with React.
I need to do this for some end to end testing.</p>

<p>here's a sandbox as a full showcase: <a href=""https://codesandbox.io/s/pp1k1kq3om"" rel=""nofollow noreferrer"">https://codesandbox.io/s/pp1k1kq3om</a>
with jquery already loaded.</p>

<p>If you run : $('#reactSlider').val(50).change() in the console, you'll notice that the change handler isn't called.</p>

<p>In the sandbox above there's also a pure html slider for comparison, that one works as expected (change function is called).</p>

<p>also tried to dispatch a new event like this:</p>

<pre><code>var event = new Event('change')
var target = $('#reactSlider')[0];
target.dispatchEvent(event);
</code></pre>

<p>The above doesn't work either (and does work on the pure html slider).</p>

<pre><code>import React from ""react"";
import { render } from ""react-dom"";

const changeHandler = event =&gt; {
  alert(`react slider changed:${event.target.value}`);
};

const App = () =&gt; (
  &lt;div&gt;
    &lt;label htmlFor=""reactSlider""&gt;react-slider&lt;/label&gt;
    &lt;input
      id=""reactSlider""
      type=""range""
      onChange={changeHandler}
      min={10}
      max={100}
      step={10}
      value={20}
    /&gt;
    &lt;p&gt;run in the console: $('#reactSlider').val(50).change()&lt;/p&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    &lt;p&gt;Notice that for the React slider, the change event is not triggered.&lt;/p&gt;
  &lt;/div&gt;
);

render(&lt;App /&gt;, document.getElementById(""root""));
</code></pre>
",https://stackoverflow.com/questions/49783314/trigger-change-event-for-react-rendered-input-type-range,"['javascript', 'jquery', 'reactjs', 'dom', 'dom-events']",2596,FALSE,0,1
How to access cross data store sequence generated ID within the same use case,"<p>I am working on one end to end testing scenario where I need a user record perf map use a key which is a reference to meta_table id within the same use case. </p>

<p>While user data is stored in NoSQL database, meta_table is stored in RDBMS and uses autogenerated id, so each time I run only a test workflow 
meta_table for the same use cases is having completely new id generated.</p>

<p>Here is my data setup workflow:</p>

<pre><code>pipeline:
  db1:
    register:
      action: dsunit:register
      datastore: db1
      config:
        driverName: mysql
        descriptor: '[username]:[password]@tcp(127.0.0.1:3306)/[dbname]?parseTime=true'
        credentials: $mysqlCredentials
        parameters:
          dbname: db1
    prepare:
      sequence:
        datastore: db1
        action: dsunit.sequence
        tables:
        - meta_table
        post:
        - seq = $Sequences
      data:
        action: nop
        init:
        - db1key = data.db1.setup
        - db1Setup = $AsTableRecords($db1key)
      setup:
        datastore: db1
        action: dsunit:prepare
        data: $db1Setup
  db2:
    register:
      action: dsunit:register
      datastore: db2
      config:
        driverName: aerospike
        descriptor: tcp([host]:3000)/[namespace]
        parameters:
          namespace: test
          host: 127.0.0.1
          port: 3000
    prepare:
      data:
        action: nop
        init:
        - db2key = data.db2.setup
        - db2Setup = $AsTableRecords($db2key)
      setup:
        datastore: db2
        action: dsunit:prepare
        data: $db2Setup
</code></pre>

<p>And there are my data files:</p>

<pre><code>@db1_setup.json

[
  {
    ""Table"": ""meta_table"",
    ""Value"": {
      ""id"": ""$seq.meta_table"",
      ""name"": ""Name 1"",
      ""type_id"": 1
    },
    ""PostIncrement"": [
      ""seq.meta_table""
    ],
    ""Key"": ""${tagId}_meta_table""
  }
]



@db2_setup.json

[
  {
    ""Table"": ""user"",
    ""Value"": {
      ""id"": ""$userID"",
      ""email"": ""user@abc.com"",
      ""perf"": {
        ""??meta_table.id here??"": ""$timestamp""
      }
    },
    ""AutoGenerate"": {
      ""userID"": ""uuid.next""
    },
    ""Key"": ""${tagId}_user""
  }
]
</code></pre>

<p>I am looking for a valid expression to replace: </p>

<pre><code>""??meta_table.id here??"" 
</code></pre>

<p>to expand to meta_table.id, </p>

<p>I have tried the following, but none worked:</p>

<ul>
<li>$meta_table.id </li>
<li>${meta_table.id}</li>
</ul>
",https://stackoverflow.com/questions/50416439/how-to-access-cross-data-store-sequence-generated-id-within-the-same-use-case,"['end-to-end', 'endly']",17,FALSE,0,1
Different locations of file downloads,"<p>I am using webdriver.io for my end-to-end testing. I want to check if proper files are being downloaded.</p>

<p>My problem is with the file download location. I want to use separate downloads directory for each test browser instance (hence for each test file), because I want to have fresh directory under test.</p>

<p>I tried to set (in wdio.conf.js):</p>

<pre><code>chromeOptions.prefs['download.default_directory'] = path.join(__dirname, ""/downloads/"", browserName, process.pid.toString()); 
</code></pre>

<p>using PID of the process, but it does not work. But the process.pid is the same for all tests. So how can I accomplished that? How to set different download directory (for Chrome browser) for each test browser instance and then grab that directory path in the test itself?</p>
",https://stackoverflow.com/questions/52079890/different-locations-of-file-downloads,"['selenium', 'selenium-webdriver', 'webdriver-io']",276,FALSE,-1,1
how to specify commit in docker-compose remote github build,"<p>I want to build services using <code>Dockerfiles</code> in remote projects found on github. This is for an end-to-end testing framework, so I need to be able to specify specific commits I want it to build. I am having a lot of difficulty trying to figure out how to pull a specific commit.</p>

<p>I have a docker compose file which looks something like this:</p>

<pre><code>version: '3'
services:
  web:
    build: https://${GITHUB_ACCESS}:@github.com/mycompany/web.git#${COMMIT_SHA}
</code></pre>

<p>The above works fine if I omit <code>#${COMMIT_SHA}</code>. Unfortunately, if I include the sha for the specific commit I care about, I get the following error:</p>

<pre><code>ERROR: error fetching: error: no such remote ref &lt;commit sha&gt;
: exit status 128
</code></pre>

<p>I am certain the sha exists, and I have tried it with a few others just to be sure. Am I getting the syntax wrong here, or does docker-compose not support referring to a specific commit?</p>
",https://stackoverflow.com/questions/48432881/how-to-specify-commit-in-docker-compose-remote-github-build,"['git', 'docker', 'github', 'build', 'docker-compose']",4768,TRUE,10,1
What&#39;s an efficient way to select an element by accessibility label in selenium-webdriver and appium?,"<p>I've just started auto end-to-end testing with my react native app, both ios and android, context is nodejs. Client is <code>selenium-webdriver</code>, which connects to <code>appium</code> server.</p>

<p>According to several sources, the best way to locate an element in React Native is to supply an <code>accessibilityLabel</code> to a <code>View</code>. However, in <code>selenium-webdriver</code>, there's no such function like:</p>

<p><code>driver.find_elements_by_accessibility_id('some id')</code></p>

<p>Currently I'm using a workaround instead:</p>

<p><code>driver.findElement(By.xpath('//*[@accessibilityLabel=""some label""]'))</code></p>

<p>As it traverses all attributes of all elements, not hard to imagine its low efficiency. What could be a better approach?</p>

<p><strong>P.S.</strong> I chose <code>selenweb driveriver</code> as client because it's also used for testing our web app, so I don't need to go through another learning curve. But if needed, I'm happy to switch to another client.</p>
",https://stackoverflow.com/questions/48636086/whats-an-efficient-way-to-select-an-element-by-accessibility-label-in-selenium,"['node.js', 'selenium', 'react-native', 'appium']",2283,FALSE,3,1
How can I import a redux saga yield into my detox + jest test file. I need gain access to data stored in the redux store in my test setup,"<p>This is a react-native application and I am currently writing some end-to-end testing.</p>

<p>A token is stored in the redux store shown below and I am testing the login functionality using detox/jest. I need to detect if the token exists in the store in my login.spec.js . If the token exists I want to wipe it from the store so the user is not logged in automatically when i reload the app to take the user back to another scene. The main function in question is the refreshUserToken() and line:-</p>

<pre><code>const { refresh_token } = yield select(token);
</code></pre>

<p>Here is the redux saga file User.js located at:-MyApp/App/Sagas/User.js</p>

<pre><code>import { call, put, takeEvery, select } from ""redux-saga/effects"";
import Config from ""MyApp/App/Config"";
import API from ""MyApp/App/Services/API"";
import { when } from ""MyApp/App/Helpers/Predicate"";
import Credentials from ""MyApp/App/Helpers/Credentials"";
import ActionCreator from ""MyApp/App/Actions"";

const appendPayload = payload =&gt; {
  return {
    ...payload,
    // Removed because no longer needed unless for testing purposes.
    // username: Config.TEST_USERNAME,
    // password: Config.TEST_PASSWORD,
    client_id: Config.CLIENT_ID,
    client_secret: Config.CLIENT_SECRET,
  };
};

const token = state =&gt; state.token;

const user = state =&gt; state.user;


const attemptUserLogin = function*(action) {
  const { payload } = action;
  const login = ""/oauth/token"";
  const grant_type = ""password"";
  const loginPayload = appendPayload(payload);

  action.payload = {
    ...loginPayload,
    grant_type,
  };

  yield attemptUserAuthorisation(login, action);
};

const attemptUserRegister = function*(action) {
  const register = ""/api/signup"";
  const { payload } = action;
  yield Credentials.save(payload);
  yield put(ActionCreator.saveUserCredentials(payload));
  yield attemptUserAuthorisation(register, action);
};

const refreshUserToken = function*(action) {
  const login = ""/oauth/token"";
  const grant_type = ""refresh_token"";
  const { refresh_token } = yield select(token);

  action.payload = {
    ...action.payload,
    grant_type,
    refresh_token,
  };
  yield attemptUserAuthorisation(login, action);
};

const watchExampleSaga = function*() {
  yield takeEvery(ActionCreator.AUTO_USER_LOGIN, autoUserLogin);
  yield takeEvery(ActionCreator.USER_LOGIN, attemptUserLogin);
  yield takeEvery(ActionCreator.USER_REGISTER, attemptUserRegister);
  yield takeEvery(ActionCreator.USER_REFRESH_TOKEN, refreshUserToken);
};

export default watchExampleSaga;
</code></pre>

<p>Here is my detox/jest spec file located at:-MyApp/App/e2e/login.spec.js</p>

<pre><code>    describe('Login Actions', () =&gt; {

  it('Should be able to enter an email address', async () =&gt; {
    await element(by.id('landing-login-btn')).tap()
    const email = 'banker@dovu.io'

    await element(by.id('login-email')).tap()
    await element(by.id('login-email')).replaceText(email)
  });

  it('Should be able to enter a password', async () =&gt; {
    const password = 'secret'

    await element(by.id('login-password')).tap()
    await element(by.id('login-password')).replaceText(password)
  });

  it('Should be able to click the continue button and login', async () =&gt; {
    await element(by.id('login-continue-btn')).tap()
    await waitFor(element(by.id('dashboard-logo'))).toBeVisible().withTimeout(500)

    // If token exists destroy it and relaunch app. This is where I need to grab the token from the redux saga!
    await device.launchApp({newInstance: true});
  });
})
</code></pre>
",https://stackoverflow.com/questions/51903590/how-can-i-import-a-redux-saga-yield-into-my-detox-jest-test-file-i-need-gain,"['react-native', 'redux', 'react-redux', 'jestjs', 'redux-saga']",464,TRUE,0,2
how to type in multiple input instances with same name using cypress,"<p>I have to do an end to end testing on angularjs application using cypress.</p>

<p>I have two instances of the same input element. They have the same ng-model, class and name. We have got the unique id which is dynamically generated by the application which cannot be same everytime the page loads or if it's tested on a different machine.</p>

<p>As an example below, there are two input elements with the same name, but I would need the same text to appear on both the input elements. When I use the following commands, cypress is complaining about two instances of the same name. How can I type the same text'Hello world' on both the input elements with same name?</p>



<pre><code>cy.get('input[name=description]').type('Hello World')
</code></pre>
",https://stackoverflow.com/questions/48361749/how-to-type-in-multiple-input-instances-with-same-name-using-cypress,"['angularjs', 'cypress']",7953,TRUE,4,3
"Programatically logging in as admin user on Drupal 8, using Cypress","<p>Trying to test some content creation test using cypress on Drupal 8 site, however having trouble logging in programatically as recommended on Cypress's doc
(<a href=""https://docs.cypress.io/guides/getting-started/testing-your-app.html#Logging-in"" rel=""nofollow noreferrer"">https://docs.cypress.io/guides/getting-started/testing-your-app.html#Logging-in</a>)</p>

<p>Followed the steps on this site (<a href=""https://sevaa.com/blog/2018/10/end-to-end-testing-with-drupal-and-cypress/"" rel=""nofollow noreferrer"">https://sevaa.com/blog/2018/10/end-to-end-testing-with-drupal-and-cypress/</a>), but when I ran cy.login(username, pwd)(I'm using actual value, not undefined variable...), always get 403 forbidden error.</p>

<p>Also, while I'm able to login using UI and I can navigate admin section of Drupal by clicking on links, but soon as I use cy.visit('/admin/content') I get 403 error...</p>

<p>Has anyone successfully bypass this 403 errors by logging in programatically?
And if so, how did you manage to do so?</p>
",https://stackoverflow.com/questions/53530502/programatically-logging-in-as-admin-user-on-drupal-8-using-cypress,"['drupal', 'drupal-8', 'cypress']",460,FALSE,0,1
How to programmatically start/stop Metro Bundler,"<p>I'm trying to setup Continuous Integration for a React-Native project and run into some problems with the end to end testing, notably around the Metro bundler.</p>

<p>It seems that using the react-native script is not reliable in this case:</p>

<ul>
<li>The iOS build spontaneously spawns a bundler in a new terminal and leaves it running after the build.</li>
<li>The Android build relies on a running instance which must be started manually beforehand.</li>
<li>The bundler can't be stopped by other means than signalling it (Ctrl+C or kill).</li>
<li>There's no synchronization with the build to ensure the bundler is ready to process when the app launches.</li>
</ul>

<p>I would like to write a custom script that can start Metro, run the tests once the server is ready, and finally stop the server to cleanup the environment.</p>
",https://stackoverflow.com/questions/52766315/how-to-programmatically-start-stop-metro-bundler,"['node.js', 'react-native', 'detox', 'metro-bundler']",10723,TRUE,3,1
React Native + Appium testing nested accessibility labels,"<p>I have a couple of custom components in React Native that I'd like access to when doing end-to-end testing with Appium. Some of my components have nested Views, for example (with unnecessary details removed):</p>

<p><strong>MyView</strong></p>

<pre><code>&lt;View accessibilityLabel={this.props.accessibilityLabel}&gt;
      &lt;TextInput accessibilityLabel={'input'} /&gt;
      &lt;Text accessibilityLabel={'error'}&gt;{this.props.error}&lt;/Text&gt;
&lt;/View&gt;
</code></pre>

<p>Note how the containing view has its accessibility label set by the parent. </p>

<p>I have a view that contains multiple of the view above, like such:</p>

<pre><code>&lt;MyView accessibilityLabel={'email'}/&gt;
&lt;MyView accessibilityLabel={'password'}/&gt;
&lt;MyView accessibilityLabel={'confirmPassword'}/&gt;
</code></pre>

<p>In Appium, I'd like to access the <code>TextInput</code> field of each of the elements separately, like so:</p>

<pre><code>const emailInput = await driver.elementByAccessibilityId('email')
     .elementByAccessibilityId('input');
const passwordInput = await driver.elementByAccessibilityId('password')
     .elementByAccessibilityId('input');
</code></pre>

<p>However, <code>passwordInput</code> does not load correctly. Are <code>accessibilityLabel</code>s required to be unique? Is nesting them impossible? And how would I solve the problem?</p>

<p>I am aware that I can just include another <code>prop</code> to hold the <code>accessibilityLabel</code> of <code>TextInput</code> within <code>MyView</code>, but that seems rather bloated and is not the answer I'm looking for.</p>
",https://stackoverflow.com/questions/51639678/react-native-appium-testing-nested-accessibility-labels,"['reactjs', 'react-native', 'appium', 'e2e-testing']",1456,FALSE,0,0
Can I automate a TFS reverse integration merge,"<p>We have multiple stand-alone hybrid dev/test teams, each with their own environments where code is written and tested as a complete unit.  When an environment is in a tested deployable state, they merge from their main branch to an Integration branch.  We also have a true test environment where we can do full end-to-end testing of the entire ecosystem before moving to production.  </p>

<p>Here's an abbreviated diagram of the structure:</p>

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

<p>Does TFS have an automate a process where any changes checked in to the _Pretest branch would be merged to the team branches?  I would prefer that if one team breaks what another team is doing, we break it in a dev environment and as early as possible.  </p>

<p>(I know a big part of the answer is unit tests... we're working on it!)</p>
",https://stackoverflow.com/questions/49419640/can-i-automate-a-tfs-reverse-integration-merge,"['tfs', 'continuous-integration', 'branching-and-merging']",640,TRUE,1,1
How to write unit and/or integration tests for an angular app that uses PouchDB,"<p>I am working with a large AngularJS + PouchDB codebase. We are using Protractor for end-to-end testing, but we found ourselves relying too much on end-to-end tests. These are slow and often fail intermittently.</p>

<p>We would like to migrate as much of our testing to unit tests and/or integration tests. We have a working karma-jasmine setup that we use to test some code that doesn't interact with the database. We would like to use Karma to test code that does interact with the database but are not sure of the best way to do this.</p>

<p>Here is one example:</p>

<pre><code>""use strict"";

var FooService;

describe('The FooService', function () {
  beforeEach(function () {
    angular.mock.module('myApp');
  });

  beforeEach(angular.mock.inject(function (_FooService_) {
     FooService = _FooService_;
  }));

  it('should be able to return all bars', function() {
    let bars = FooService.getBars();
  });
});
</code></pre>

<p>This fails because the <code>FooService.getBars()</code> method calls PouchDB which has not been initialized.</p>

<p>Do you have a similar codebase and use unit and/or integration testing? If so, how did you address this problem?</p>
",https://stackoverflow.com/questions/49435227/how-to-write-unit-and-or-integration-tests-for-an-angular-app-that-uses-pouchdb,"['angularjs', 'unit-testing', 'integration-testing', 'karma-jasmine', 'pouchdb']",469,TRUE,1,1
Testing Ionic App on real Android Device with Protractor and Appium,"<p>I'm trying to test an Ionic 3 App on a real device with Protractor and Appium. I've been using these two articles to help me along the way:</p>

<ul>
<li><a href=""https://www.joshmorony.com/e2e-end-to-end-testing-in-ionic-2-an-introduction/"" rel=""nofollow noreferrer"">https://www.joshmorony.com/e2e-end-to-end-testing-in-ionic-2-an-introduction/</a></li>
<li><a href=""https://crondev.wordpress.com/2018/04/23/e2e-tests-for-ionic-or-any-other-hybrid-app/"" rel=""nofollow noreferrer"">https://crondev.wordpress.com/2018/04/23/e2e-tests-for-ionic-or-any-other-hybrid-app/</a></li>
</ul>

<p>Here is my <em>protractor.conf.js</em>:</p>

<pre><code>/**
 * Protractor Config
 */
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;

exports.config = {
    seleniumAddress: 'http://localhost:4723/wd/hub',
    specs: ['./e2e/**/*.e2e-spec.ts'],
    multiCapabilities: [{
        browserName: '',
        appPackage: 'de.softwareforen.mapp.app',
        appActivity: '.MainActivity',
        platformName: 'Android',
        platformVersion: '5.1.1',
        deviceName: 'Samsung Galaxy J3 (2016)',
        autoAcceptAlerts: 'true',
        autoWebView: true
    }],
    framework: 'jasmine',
    SELENIUM_PROMISE_MANAGER: false,
    useAllAngular2AppRoots: true,
    random: false,
    jamineNodeOpts: {
        random: false
    },
    onPrepare: function() {
        jasmine.getEnv().addReporter(new SpecReporter());
    },
    beforeLaunch: async () =&gt; {
        require('ts-node').register({
            project: 'e2e'
        });
    }
}
</code></pre>

<p>I have a tsconfig.json (like in the first article) and a simple test in a folder ""e2e"". The app has been deployed on the device (via <code>ionic cordova run android --device</code>). I start appium (tried it with and without the chromedriver executable, same result) and protractor. The App gets opened briefly (~3 seconds) on the device but gets closed again while still on the splash screen.</p>

<p>This is the relevant appium output:</p>

<pre><code>[debug] [ADB] Running 'C:\Users\JWA\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 420059d197897400 shell am start -W -n de.softwareforen.mapp.app/.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'
[Appium] New AndroidDriver session created successfully, session 33b83913-d588-44ea-a137-033b60db7f56 added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1525769479329 (10:51:19 GMT+0200 (Mitteleuropäische Sommerzeit))
[debug] [MJSONWP] Responding to client with driver.createSession() result: {""platform"":""LINUX"",""webStorageEnabled"":false,""takesScreenshot"":true,""javascriptEnabled"":true,""databaseEnabled"":false,""networkConnectionEnabled"":true,""locationContextEnabled"":false,""warnings"":{},""desired"":{""browserName"":"""",""appPackage"":""de.softwareforen.mapp.app"",""appActivity"":"".MainActivity"",""platformName"":""Android"",""platformVersion"":""5.1.1"",""deviceName"":""Samsung Galaxy J3 (2016)"",""autoAcceptAlerts"":""true"",""autoWebView"":true,""count"":1},""browserName"":"""",""appPackage"":""de.softwareforen.mapp.app"",""appActivity"":"".MainActivity"",""platformName"":""Android"",""platformVersion"":""5.1.1"",""deviceName"":""420059d197897400"",""autoAcceptAlerts"":""true"",""autoWebView"":true,""count"":1,""deviceUDID"":""420059d197897400"",""deviceScreenSize"":""720x1280"",""deviceModel"":""SM-J320F"",""deviceManufacturer"":""samsung""}
[HTTP] &lt;-- POST /wd/hub/session 200 34095 ms - 857
[HTTP]
[HTTP] --&gt; POST /wd/hub/session/33b83913-d588-44ea-a137-033b60db7f56/timeouts
[HTTP] {""script"":11000}
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted ""MJSONWP protocol requires type and ms"" and you sent {""script"":11000}
[HTTP] &lt;-- POST /wd/hub/session/33b83913-d588-44ea-a137-033b60db7f56/timeouts 400 4 ms - 106
[HTTP]
[HTTP] --&gt; POST /wd/hub/session/33b83913-d588-44ea-a137-033b60db7f56/timeouts
[HTTP] {""type"":""script"",""ms"":11000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [{""protocol"":""MJSONWP"",""type"":""script"",""ms"":11000},""33b83913-d588-44ea-a137-033b60db7f56""]
[debug] [BaseDriver] type: script, ms: 11000
[HTTP] &lt;-- POST /wd/hub/session/33b83913-d588-44ea-a137-033b60db7f56/timeouts 501 8 ms - 118
[HTTP]
[HTTP] --&gt; DELETE /wd/hub/session/33b83913-d588-44ea-a137-033b60db7f56
[HTTP] {}
[debug] [MJSONWP] Calling AppiumDriver.deleteSession() with args: [""33b83913-d588-44ea-a137-033b60db7f56""]
[debug] [BaseDriver] Event 'quitSessionRequested' logged at 1525769479399 (10:51:19 GMT+0200 (Mitteleuropäische Sommerzeit))
[Appium] Removing session 33b83913-d588-44ea-a137-033b60db7f56 from our master session list
[debug] [AndroidDriver] Shutting down Android driver
</code></pre>

<p>And this is the protractor output:</p>

<pre><code>[10:50:45] I/launcher - Running 1 instances of WebDriver
[10:50:45] I/hosted - Using the selenium server at http://localhost:4723/wd/hub
[10:51:19] E/runner - Unable to start a WebDriver session.
[10:51:22] E/launcher - Error: WebDriverError: Not implemented yet for script.
    at Object.checkLegacyResponse (C:\Users\JWA\Documents\Projekte\MAPP\mapp-app\node_modules\selenium-webdriver\lib\error.js:546:15)
    at parseHttpResponse (C:\Users\JWA\Documents\Projekte\MAPP\mapp-app\node_modules\selenium-webdriver\lib\http.js:509:13)
    at doSend.then.response (C:\Users\JWA\Documents\Projekte\MAPP\mapp-app\node_modules\selenium-webdriver\lib\http.js:441:30)
    at &lt;anonymous&gt;
    at process._tickCallback (internal/process/next_tick.js:188:7)
[10:51:22] E/launcher - Process exited with error code 100
</code></pre>

<p>Looks like a timeout problem. Unfortunately I have not been able to solve it so far.</p>
",https://stackoverflow.com/questions/50229900/testing-ionic-app-on-real-android-device-with-protractor-and-appium,"['android', 'ionic-framework', 'protractor', 'appium']",866,FALSE,0,1
Using something other than cy.request to seed data in Cypress,"<p>I'm using Cypress for end-to-end testing. In my <code>beforeEach</code>, I'm using an SDK I've been provided to seed data on a server (the SDK sends API calls to the server but does not use <code>cy.request</code> inside it). The method on the SDK returns a promise, therefore I figured I could return the promise like so:</p>

<pre><code>beforeEach(() =&gt; {
  return sdk.createProperty(...);
});
</code></pre>

<p>My test then does something like this:</p>

<pre><code>it('displays a property', () =&gt; {
    cy.visit(`/companies/${appTestData.companyId}/properties`);
    ...the rest is commented out currently...
}
</code></pre>

<p>This actually works as intended, that is, it waits until the server response is returned before running the tests, but I see the following warning in the console when the test actually runs:</p>

<pre><code>Cypress Warning: Cypress detected that you returned a promise in a test, but also invoked one or more cy commands inside of that promise...
</code></pre>

<p>I noticed if I change my <code>beforeEach</code> to use <code>cy.then</code>, the warning goes away:</p>

<pre><code>beforeEach(() =&gt; {
  cy.then(() =&gt; sdk.createProperty(...));
});
</code></pre>

<p>It seems a bit unnecessary and was kind of a stab in the dark, so I'd like to know if there's a prescribed way of doing what I need to do. I can't change the SDK I'm using to use <code>cy.request</code>, which I assume would also prevent the warning. Thanks.</p>
",https://stackoverflow.com/questions/51522936/using-something-other-than-cy-request-to-seed-data-in-cypress,['cypress'],1339,TRUE,2,1
How do you test chained API calls in React with Jest?,"<p>I have a save workflow in my react/redux app that requires two API calls. The second call only happens once the first call is completed successfully. The app is working great and I'm adding some automated end-to-end testing now.</p>

<p>I'm able to trigger the <code>onSave</code> function and verify the call to <code>saveRates</code>, but I'm having trouble getting the second API call to fire in my tests. Here's the code</p>

<pre><code>function onSave() {
  // PUT to /rates/&lt;id&gt;
  dispatchProps.saveRates()
  .then(() =&gt; {
    // PUT to /apps/&lt;id&gt;
    dispatchProps.saveApplications()
    .then(() =&gt; {
      // Done
    });
  });
}
</code></pre>

<p>And this is the test code. I'm using Axios for the API calls in the app and <code>jest-mock-axios</code> to mock axios in my tests.</p>

<pre><code>// At this point, `onSave` has been called


// This test passes
expect(mockAxios.put).toHaveBeenCalledWith(`rates/${rateId}`, { rate: { id: rateId }});
mockAxios.mockResponse({ status: 200 }, mockAxios.lastReqGet());

// This test fails with the error indicating that the expected API call was actually `PUT rates/&lt;id&gt;`
expect(mockAxios.put).toHaveBeenCalledWith(`app/${appId}`, { app: { id: appId, rate: rateId }});
mockAxios.mockResponse({ status: 200 }, mockAxios.lastReqGet());
</code></pre>

<p>It seems as though the promise from the first API call, <code>saveRates</code> hasn't been resolved. The <code>mockResponse</code> call resolves the promise but, using the jest debugger I can see that the call to <code>saveApplications</code> never happens.</p>

<p><a href=""https://www.npmjs.com/package/jest-mock-axios#axiosmockresponseresponse-requestinfo"" rel=""nofollow noreferrer"">https://www.npmjs.com/package/jest-mock-axios#axiosmockresponseresponse-requestinfo</a></p>

<p>How to I tell jest to wait until the next API call happens? Do I need to return the promises from the <code>onSave</code> call?</p>

<p><strong>UPDATE</strong></p>

<p>This works...so I suspect it can be solved with an <code>await</code> somewhere.</p>

<pre><code>expect(mockAxios.put).toHaveBeenCalledWith(`taxes/event/${window.storeAdminTaxEventUuid}/rates/customer`, taxRatesResponse.data.customer);
    mockAxios.mockResponse({ status: 200 }, mockAxios.lastPromiseGet());

    setTimeout(() =&gt; {      
      expect(mockAxios.put).toHaveBeenCalledWith(`taxes/event/${window.storeAdminTaxEventUuid}/application/products`, taxApplicationsResponse.data);    
      mockAxios.mockResponse({ status: 200 });
    }, 0);
</code></pre>
",https://stackoverflow.com/questions/53120820/how-do-you-test-chained-api-calls-in-react-with-jest,"['reactjs', 'jestjs', 'jest-mock-axios']",659,FALSE,3,0
Create SQL Server database from a script in docker,"<p>Simple question I hope. I cannot find anything anywhere.</p>

<p>How do you create a database in a <code>Microsoft SQL Server</code> <code>Docker</code> container?  </p>

<p><strong>Dockerfile</strong>:</p>

<p>I am looking at the following <code>Dockerfile</code>:</p>

<pre><code>FROM microsoft/mssql-server-windows-developer:latest

ENV sa_password ab873jouehxaAGR

WORKDIR /
COPY /db-scripts/create-db.sql .

# here be the existing run commnd in the image microsoft/mssql-server-windows-developer:latest
#CMD [""powershell"", ""-Command"", ""$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"", "".\\start -sa_password $env:sa_password -ACCEPT_EULA $env:ACCEPT_EULA -attach_dbs \\\""$env:attach_dbs\\\"" -Verbose"" ]

RUN (sqlcmd -S localhost -U SA -P ab873jouehxaAGR -i create-db.sql)
</code></pre>

<p><strong>docker-compose.yml</strong>:</p>

<p>I have put together the following docker compose file:</p>

<pre><code>version: '3.4'

services: 
  sql.data:
    image: ${DOCKER_REGISTRY}myfirst-mssql:latest
    container_name: myfirst-mssql_container
    build:
      context: .
      dockerfile: ./Dockerfile
    environment:
      SA_PASSWORD: ab873jouehxaAGR
      ACCEPT_EULA: Y
</code></pre>

<p><strong>Bringing it together</strong></p>

<p>I am running the command <code>docker-compose up</code> against the above.  And assuming <code>create-db.sql</code> file will simply create a database which is not relevant here to keep things minimal.</p>

<p><strong>Errors</strong></p>

<p>The error I get above is that the login for SA is invalid when it runs the <code>.sql</code> script:</p>

<pre><code>Step 7/7 : RUN (sqlcmd -S localhost -U SA -P ab873jouehxaAGR -i create-db.sql)
 ---&gt; Running in 2ac5644d0bd9
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login failed for user 'SA'..
</code></pre>

<p>It looks like this runs before the password has been changed to ab873jouehxaAGR which typically looks like the command from <code>mssql-server-windows-developer:latest.json</code> from inspecting the image in vscode - <code>\start -sa_password $env:sa_password -ACCEPT_EULA $env:ACCEPT_EULA -attach_dbs</code> actually does.</p>

<p><strong>Environment</strong></p>

<p>I am running docker <code>Docker version 18.06.1-ce, build e68fc7a</code> on Windows 10.</p>

<p><strong>Attach or script</strong></p>

<p>I am not specifying attaching a database using the environment variable <code>attach_dbs</code> of which I see in many examples.</p>

<p>I am trying to find a best practice for managing a sql container from a point of view of end to end testing and a lot of articles seem to not cover the data aspect part - ie <a href=""https://learn.microsoft.com/en-us/dotnet/standard/microservices-architecture/docker-application-development-process/docker-app-development-workflow"" rel=""nofollow noreferrer"">Development Workflow</a></p>

<p>I would be interested to hear in comments thoughts on these two approaches in the Docker world.</p>
",https://stackoverflow.com/questions/52105555/create-sql-server-database-from-a-script-in-docker,"['sql-server', 'docker', 'docker-compose', 'containers', 'dockerfile']",7207,FALSE,3,1
Using virtual environments to manage develop/deploy packages in Jupyterhub,"<p>I have a package that I am developing for a local server. I would like to have the current stable release importable in a Jupyter notebook using <code>import my_package</code> and the current development state importable (for end-to-end testing and stuff) with <code>import my_package_dev</code>, or something like that.</p>

<p>The package is version controlled with git. The <code>master</code> branch holds the stable release, and new development work is done in the <code>develop</code> branch.</p>

<p>I currently pulled these two branches into two different folders:</p>

<pre><code>my_package/  # tracks master branch of repository
    setup.py
    requirements.txt
    my_package/
        __init__.py
        # other stuff

my_package_dev/  # tracks develop branch of repository
    setup.py
    requirements.txt
    my_package/
        __init__.py
        # other stuff for dev branch
</code></pre>

<p>My <code>setup.py</code> file looks like this:</p>

<pre><code>from setuptools import setup
setup(
      name='my_package',  # or 'my_package_dev' for the dev version
      # metadata stuff...
     )
</code></pre>

<p>I can <code>pip install my_package</code> just fine, but I have been unable to get anything to link to the name <code>my_package_dev</code> in Python.</p>

<h2>Things I have tried</h2>

<ul>
<li><p><code>pip install my_package_dev</code></p>

<p>Doesn't seem to overwrite the existing <code>my_package</code>, but doesn't seem to make <code>my_package_dev</code> available either, even though pip says it finishes OK.</p></li>
<li><p><code>pip install -e my_package_dev</code></p>

<p>makes an egg and puts the development package path in <code>easy-install.pth</code>, but I cannot <code>import my_package_dev</code>, and <code>my_package</code> is still the old content.</p></li>
<li><p>Adding a file <code>my_package_dev.pth</code> to site-packages directory and filling it with <code>/path/to/my_package_dev</code></p>

<p>causes no visible change. Still does not allow me to <code>import my_package_dev</code>.</p></li>
</ul>

<h2>Thoughts on a solution</h2>

<p>It looks like the best approach is going to be to use virtual environments, as discussed in the answers.</p>
",https://stackoverflow.com/questions/50456390/using-virtual-environments-to-manage-develop-deploy-packages-in-jupyterhub,"['python', 'ipython', 'virtualenv', 'jupyter']",166,TRUE,0,2
Is there a --disable-web-security fix for recent changes of Chrome ~70?,"<p>I do cross-origin, cross-frame scripting in one of my projects (end to end testing with client side js without selenium) and that project highly relies on the <code>--disable-web-security</code> flag. From today one of my tests is failing. It tries to load a non-existent remote URI to a child window to check whether an error is thrown by the lib. Well I got an error, but that is a security error, so not what I expect. The other tests are between the karma server on <code>localhost:9876</code> and a node server on <code>localhost:4444</code>. Those are working properly. My karma contains a Chrome custom launcher with the flag:</p>

<pre><code>    customLaunchers: {
        ""ch"": {
            ""base"": ""Chrome"",
            ""flags"": [""--disable-web-security""]
        }
    },
</code></pre>

<p>As far as I know it needs some sort of user dir too, but the Karma launcher fills that param. Any idea about whether I can fix this or at least what release of Chrome changed the behavior? (I have already sent a bug report.)</p>

<p>Note that the question has nothing to do with Karma. All it does is starting Chrome from CLI with the given flags. A possible fix would be adding another flag, like the <code>--user-data-dir</code> was, but I guess the current changes are intentional and they cannot be undone. I'd like to see where this was discussed. I only found a 5 years old topic in Chromium Google Gorups which discusses this: <a href=""https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/iivpdszNY3I/3o3BF_mGwlIJ"" rel=""nofollow noreferrer"">https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/iivpdszNY3I/3o3BF_mGwlIJ</a></p>
",https://stackoverflow.com/questions/53098579/is-there-a-disable-web-security-fix-for-recent-changes-of-chrome-70,"['javascript', 'google-chrome']",695,TRUE,5,1
End to end test of electron app on Windows,"<h3>What I am trying to achieve:</h3>

<p>I'd like to set up an electron project with a proper headless end-to-end testing configuration.</p>

<h3>Issues encountered</h3>

<p>Spectronjs seems to be the solution to achieve so. However there is no configuration to prevent the window from opening on each test. Reading some of the threads on the repository + the documentation of electron in regards to testing mentions Xvfb. I've tried to get my head around this but understand so far that this cannot be installed on Windows? And that there is no alternative.</p>

<p>The list on the page includes other options such as Appvoyer or CicleCI but these again are new and I am barely able to find a guide around these not to mention, I am not really liking that I have to do all these steps (link to github/bitbucket account, etc).</p>

<p>I've also tried to go through demo applications from the electronjs list page, but not all of them do have tests, and when they do, they are sometime written in what seems to be a different programming language, or specifically aimed for angular or react, while on my end I am aiming to use vuejs.</p>

<p>Can anyone point me to a clean example of an offline end to end headless test of an electron app on Windows?</p>
",https://stackoverflow.com/questions/53243020/end-to-end-test-of-electron-app-on-windows,"['electron', 'e2e-testing', 'headless-browser', 'xvfb']",2462,TRUE,4,1
How can I correctly provide a mock webcam video to Chrome?,"<p>I'm trying to run end-to-end testing in Chrome for a product that requires a webcam feed halfway through to operate. From what I understand this means providing a fake webcam video to Chrome using the <code>--use-file-for-fake-video-capture=""/path/to/video.y4m""</code> command line argument. It will then use that as a webcam video.</p>

<p>However, no matter what y4m file I provide, I get the following error from Chrome running under these conditions:</p>

<pre class=""lang-none prettyprint-override""><code>DOMException: Could not start video source
{
  code: 0,
  message: ""Could not start video source"",
  name: ""NotReadableError""
}
</code></pre>

<p>Notably <strong>I can provide an audio file just fine</strong> using <code>--use-file-for-fake-audio-capture</code> and Chrome will work with it well. The video has been my sticking point.</p>

<p>This error comes out of the following straightforward mediaDevices request:</p>

<pre class=""lang-js prettyprint-override""><code>navigator.mediaDevices.getUserMedia({ video: true, audio: true })
  .then(data =&gt; {
    // do stuff
  })
  .catch(err =&gt; {
    // oh no!
  });
</code></pre>

<p>(This always hits the “oh no!” branch when a video file is provided.)</p>

<h1>What I've tried so far</h1>

<p>I've been running Chrome with the following command line arguments (newlines added for readability), and I'm using a Mac hence the <code>open</code> command:</p>



<pre class=""lang-sh prettyprint-override""><code>open -a ""Google Chrome"" --args
  --disable-gpu
  --use-fake-device-for-media-stream
  --use-file-for-fake-video-capture=""~/Documents/mock/webcam.y4m""
  --use-file-for-fake-audio-capture=""~/Documents/mock/microphone.wav""
</code></pre>

<p><code>webcam.y4m</code> and <code>microphone.wav</code> were generated from a video file I recorded.</p>

<p>I first recorded a twenty-second mp4 video using my browser's MediaRecorder, downloaded the result, and converted it using the following command line commands:</p>

<pre class=""lang-sh prettyprint-override""><code>ffmpeg -y -i original.mp4 -f wav -vn microphone.wav
ffmpeg -y -i original.mp4 webcam.y4m
</code></pre>

<p>When this didn't work, I tried the same using a twenty-second movie file I recorded in Quicktime:</p>

<pre class=""lang-sh prettyprint-override""><code>ffmpeg -y -i original.mov -f wav -vn microphone.wav
ffmpeg -y -i original.mov webcam.y4m
</code></pre>

<p>When <em>that also</em> failed, I went straight to <a href=""https://cs.chromium.org/chromium/src/media/capture/video/file_video_capture_device.h?l=31"" rel=""noreferrer"">the Chromium file that explains fake video capture</a>, went to <a href=""https://media.xiph.org/video/derf/"" rel=""noreferrer"">the example y4m file list</a> it provided, and downloaded the grandma file and provided that as a command line argument to Chrome instead:</p>

<pre class=""lang-sh prettyprint-override""><code>open -a ""Google Chrome"" --args
  --disable-gpu
  --use-fake-device-for-media-stream
  --use-file-for-fake-video-capture=""~/Documents/mock/grandma_qcif.y4m""
  --use-file-for-fake-audio-capture=""~/Documents/mock/microphone.wav""
</code></pre>

<p>Chrome provides me with the <em>exact</em> same error in <em>all</em> of these situations.</p>

<p>The only time Chrome doesn't error out with that mediaDevices request is when I omit the video completely:</p>

<pre class=""lang-sh prettyprint-override""><code>open -a ""Google Chrome"" --args
  --disable-gpu
  --use-fake-device-for-media-stream
  --use-file-for-fake-audio-capture=""~/Documents/mock/microphone.wav""
</code></pre>

<h1>Accounting for C420mpeg2</h1>

<p><a href=""https://testrtc.com/y4m-video-chrome/"" rel=""noreferrer"">TestRTC</a> suggests Chrome will “crash” if I give it a <code>C420mpeg2</code> file, and recommends that simply replacing the metadata fixes the issue. Indeed the video file I generate from ffmpeg gives me the following header:</p>

<pre class=""lang-sh prettyprint-override""><code>YUV4MPEG2 W1280 H720 F30:1 Ip A1:1 C420mpeg2 XYSCSS=420MPEG2
</code></pre>

<p>Chrome doesn't actually crash when run with this file, I just get the error above. If I edit the video file to the following header though per TestRTC's recommendations I get the same situation:</p>

<pre class=""lang-sh prettyprint-override""><code>YUV4MPEG2 W1280 H720 F30:1 Ip A1:1 C420 XYSCSS=420MPEG2
</code></pre>

<p>The video file still gives me the above error in these conditions.</p>

<h1>What can/should I do?</h1>

<p>How should I be providing a video file to Chrome for this command line argument?</p>

<p>How should I be recording or creating the video file?</p>

<p>How should I convert it to y4m?</p>
",https://stackoverflow.com/questions/52095416/how-can-i-correctly-provide-a-mock-webcam-video-to-chrome,"['google-chrome', 'video', 'ffmpeg', 'mocking', 'webcam']",40155,TRUE,29,4
isDisplayed returns false for a visible element in Protractor,"<p><strong>EDIT #4</strong>: Breakthrough!!</p>

<p>I started recursively going through the parent nodes and returning the same values as below.  One of the parents--the inner <code>mat-drawer-container</code>--also returned false for isDisplayed (all the others returned true, which seems odd).</p>

<p>Looking at that node, it turns out that it's the only tag on the site to have the CSS of <strong><code>display: contents</code></strong>.  Removing that causes the button in question--<em>and</em> everything else below it--to return true for isDisplayed.  Heck, Protractor can even click the button and I can see the expected result in the browser.</p>

<p>Now I suppose the question remains: is this is expected behavior or a bug?  It's not as straightforward as there being an ancestor with display: contents applied; I applied it directly to <code>rb-container</code> and Protractor was still able to find the button.</p>

<hr>

<p>I'm working on end-to-end testing in Protractor for the first time, and I'm running into an issue when trying to test for a button being visible; despite the button element being in the DOM and visible, isDisplayed returns false and my assertion fails.</p>

<p>This is the initial assertion that's been failing:</p>

<pre><code>expect(element(by.css(""mat-drawer-content rb-container rb-fab-button[data-qaid='create-button'] &gt; button"")).isDisplayed()).toBe(true);
</code></pre>

<p>(Yes, the selector is a mess, but I don't have control over the HTML.)</p>

<p>I've used a long browser.sleep() interval to essentially pause the browser in place so I could use the dev tools to inspect the humanly-visible element, and the CSS leads me to believe it should be detected as visible.</p>

<p>After searching for answers and/or bugs to no avail, I logged some information to the console which still leads me to believe that isDisplayed should return true:</p>

<p>[ <em><strong>EDITS #2, #3:</strong> Logged some more information on all the direct children of rb-container; only one node is ""visible"", according to Protractor.</em> ]</p>

<pre><code>  let selector = element.all(by.tagName(""mat-drawer-content"")).get(0).all(by.css(""rb-container &gt; *""));

  selector.count().then(function(selCount) {

    for (let match = 0; match &lt; selCount; match ++) {

      browser.sleep(1000).then(() =&gt; {
        let elm = selector.get(match);

        console.log(""\n &gt;&gt; "" + match + ""]"");

        elm.getTagName().then(tag =&gt; { console.log(""tag name:"", tag); });
        elm.getCssValue(""visibility"").then(vis =&gt; { console.log(""visibility:"", vis); });
        elm.getCssValue(""display"").then(disp =&gt; { console.log(""display:"", disp); });
        elm.getCssValue(""opacity"").then(opa =&gt; { console.log(""opacity:"", opa); });
        elm.getCssValue(""overflow"").then(ov =&gt; { console.log(""overflow:"", ov); });
        elm.getAttribute(""hidden"").then(hid =&gt; { console.log(""hidden:"", hid); });
        elm.getAttribute(""class"").then(c =&gt; { console.log(""class:"", c)});
        elm.getSize().then(size =&gt; { console.log(""size:"", size); });
        elm.getCssValue(""position"").then(ov =&gt; { console.log(""position:"", ov); });
        elm.getLocation().then(loc =&gt; { console.log(""location:"", loc); });
        elm.isPresent().then(pres =&gt; { console.log(""isPresent:"", pres); });
        elm.isDisplayed().then(disp =&gt; { console.log(""isDisplayed:"", disp); });
      });

    }

  });
</code></pre>

<p>This is what I see logged:</p>

<pre><code> &gt;&gt; 0]
tag name: div
visibility: visible
display: block
opacity: 1
overflow: auto
hidden: null
class: title-tab dn db-m mediumGreyColor pl4 pv2 overflow-auto
size: { ceil: {},
  clone: {},
  floor: {},
  height: 62,
  round: {},
  scale: {},
  toString: {},
  width: 898 }
position: static
location: { ceil: {},
  clone: {},
  floor: {},
  round: {},
  scale: {},
  toString: {},
  translate: {},
  x: 0,
  y: 74.765625 }
isPresent: true
isDisplayed: false

 &gt;&gt; 1]
tag name: div
visibility: visible
display: block
opacity: 1
overflow: auto
hidden: null
class: player-menu container overflow-auto dn db-m pv2 ng-star-inserted
size: { ceil: {},
  clone: {},
  floor: {},
  height: 64,
  round: {},
  scale: {},
  toString: {},
  width: 834 }
position: static
location: { ceil: {},
  clone: {},
  floor: {},
  round: {},
  scale: {},
  toString: {},
  translate: {},
  x: 32,
  y: 136.765625 }
isPresent: true
isDisplayed: false

 &gt;&gt; 2]
tag name: rb-fab-button
visibility: visible
display: block
opacity: 1
overflow: visible
hidden: null
class: add-fab-button absolute dn db-m ng-star-inserted
size: { ceil: {},
  clone: {},
  floor: {},
  height: 56,
  round: {},
  scale: {},
  toString: {},
  width: 56 }
position: absolute
location: { ceil: {},
  clone: {},
  floor: {},
  round: {},
  scale: {},
  toString: {},
  translate: {},
  x: 762,
  y: 154.765625 }
isPresent: true
isDisplayed: false

 &gt;&gt; 3]
tag name: div
visibility: visible
display: block
opacity: 1
overflow: visible
hidden: null
class: mr4-l w-100-m
size: { ceil: {},
  clone: {},
  floor: {},
  height: 0,
  round: {},
  scale: {},
  toString: {},
  width: 834 }
position: static
location: { ceil: {},
  clone: {},
  floor: {},
  round: {},
  scale: {},
  toString: {},
  translate: {},
  x: 32,
  y: 200.765625 }
isPresent: true
isDisplayed: false

 &gt;&gt; 4]
tag name: rb-table-wrapper
visibility: visible
display: block
opacity: 1
overflow: visible
hidden: null
class: dn db-m
size: { ceil: {},
  clone: {},
  floor: {},
  height: 672,
  round: {},
  scale: {},
  toString: {},
  width: 834 }
position: static
location: { ceil: {},
  clone: {},
  floor: {},
  round: {},
  scale: {},
  toString: {},
  translate: {},
  x: 32,
  y: 200.765625 }
isPresent: true
isDisplayed: true

 &gt;&gt; 5]
tag name: div
visibility: visible
display: block
opacity: 1
overflow: visible
hidden: null
class: container
size: { ceil: {},
  clone: {},
  floor: {},
  height: 0,
  round: {},
  scale: {},
  toString: {},
  width: 834 }
position: static
location: { ceil: {},
  clone: {},
  floor: {},
  round: {},
  scale: {},
  toString: {},
  translate: {},
  x: 32,
  y: 872.5625 }
isPresent: true
isDisplayed: false

 &gt;&gt; 6]
tag name: rb-table-wrapper
visibility: visible
display: none
opacity: 1
overflow: visible
hidden: null
class: db dn-m
size: { ceil: {},
  clone: {},
  floor: {},
  height: 0,
  round: {},
  scale: {},
  toString: {},
  width: 0 }
position: static
location: { ceil: {},
  clone: {},
  floor: {},
  round: {},
  scale: {},
  toString: {},
  translate: {},
  x: 0,
  y: 0 }
isPresent: true
isDisplayed: false

 &gt;&gt; 7]
tag name: div
visibility: visible
display: none
opacity: 1
overflow: auto
hidden: null
class: player-menu container overflow-auto db dn-m ng-star-inserted
size: { ceil: {},
  clone: {},
  floor: {},
  height: 0,
  round: {},
  scale: {},
  toString: {},
  width: 0 }
position: static
location: { ceil: {},
  clone: {},
  floor: {},
  round: {},
  scale: {},
  toString: {},
  translate: {},
  x: 0,
  y: 0 }
isPresent: true
isDisplayed: false
</code></pre>

<p>With no hidden attribute set, a display value that isn't ""none"", visibility set to ""visible"", and non-zero size dimensions, I would expect isDisplayed to return true.  </p>

<p>It's interesting to look at node 4, the only child element for which isDisplayed returns true, and compare it with node 2, the rb-fab-button element I'm trying to access.  The only noticeable difference I can see is that rb-fab-button is positioned absolutely; however, the other statically-positioned elements also return false for isDisplayed.</p>

<p>Am I missing something?  I'd settle for checking for css visibility, but my next test is to click that button, which errors if the element is not visible.</p>

<p>[ <em><strong>EDIT #1:</strong> Added some HTML:</em> ]</p>

<p><div class=""snippet"" data-lang=""js"" data-hide=""false"" data-console=""true"" data-babel=""false"">
<div class=""snippet-code"">
<pre class=""snippet-code-html lang-html prettyprint-override""><code>&lt;mat-drawer-container _ngcontent-c0="""" class=""root-container w-100 mat-drawer-container mat-drawer-container-explicit-backdrop"" hasbackdrop=""true"" ng-reflect-has-backdrop=""true""&gt;
    &lt;div class=""mat-drawer-backdrop ng-star-inserted""&gt;&lt;/div&gt;
    &lt;div tabindex=""-1"" class=""cdk-visually-hidden cdk-focus-trap-anchor""&gt;&lt;/div&gt;
    &lt;mat-drawer _ngcontent-c0="""" class=""mobile-drawer dn-m w-80 mat-drawer ng-tns-c2-0 ng-trigger ng-trigger-transform mat-drawer-over ng-star-inserted"" tabindex=""-1"" ng-reflect-mode=""over"" style=""box-shadow: none; visibility: hidden;""&gt;
      &lt;!-- [... mobile nav ...] --&gt;
    &lt;/mat-drawer&gt;
    &lt;div tabindex=""-1"" class=""cdk-visually-hidden cdk-focus-trap-anchor""&gt;&lt;/div&gt;
    &lt;mat-drawer-content _ngcontent-c0="""" class=""mat-drawer-content""&gt;
        &lt;rb-navbar _ngcontent-c0="""" _nghost-c7="""" class=""ng-star-inserted""&gt;
          &lt;!-- [... nav bar ...] --&gt;
        &lt;/rb-navbar&gt;
        &lt;div _ngcontent-c0="""" class=""main-body""&gt;
            &lt;div _ngcontent-c0="""" class=""container h-100""&gt;
                &lt;router-outlet _ngcontent-c0=""""&gt;&lt;/router-outlet&gt;
                &lt;rb-system-setup _nghost-c18="""" class=""ng-star-inserted""&gt;
                    &lt;router-outlet _ngcontent-c18=""""&gt;&lt;/router-outlet&gt;
                    &lt;rb-site-tab class=""ng-star-inserted""&gt;
                        &lt;mat-drawer-container autosize="""" class=""mat-drawer-container"" ng-reflect-autosize=""""&gt;
                            &lt;div class=""mat-drawer-backdrop ng-star-inserted""&gt;&lt;/div&gt;
                            &lt;div tabindex=""-1"" class=""cdk-visually-hidden cdk-focus-trap-anchor""&gt;&lt;/div&gt;
                            &lt;mat-drawer class=""mat-drawer ng-tns-c2-8 ng-trigger ng-trigger-transform mat-drawer-end mat-drawer-over ng-star-inserted"" disableclose=""true"" mode=""over"" position=""end"" tabindex=""-1"" ng-reflect-position=""end"" ng-reflect-mode=""over"" ng-reflect-disable-close=""true"" style=""box-shadow: none; visibility: hidden;""&gt;
                                &lt;rb-create-site _nghost-c20="""" ng-reflect-side-panel=""[object Object]"" ng-reflect-side-panel-container=""[object Object]"" ng-reflect-ng-grid=""[object Object]"" ng-reflect-is-editing=""false"" ng-reflect-timezones=""[object Object],[object Object""&gt;
                                    &lt;rb-side-panel _ngcontent-c20="""" _nghost-c24="""" ng-reflect-title=""Add Site"" ng-reflect-close-button-label=""Cancel"" ng-reflect-submit-button-label=""CREATE_SITE.SUBMIT"" ng-reflect-show-submit-button=""true"" ng-reflect-modal-submitting=""true"" ng-reflect-side-panel-container=""[object Object]""&gt;
                                      &lt;!-- [... side panel ...] --&gt;
                                    &lt;/rb-side-panel&gt;
                                &lt;/rb-create-site&gt;
                            &lt;/mat-drawer&gt;
                            &lt;div tabindex=""-1"" class=""cdk-visually-hidden cdk-focus-trap-anchor""&gt;&lt;/div&gt;
                            &lt;mat-drawer-content cdkscrollable="""" class=""mat-drawer-content ng-star-inserted""&gt;
                                &lt;div class=""ph4-m h-100""&gt;
                                    &lt;rb-card _nghost-c21=""""&gt;
                                        &lt;div _ngcontent-c21="""" class=""card rb-min-width-1 h-100""&gt;
                                            &lt;div _ngcontent-c21="""" class=""relative h-100""&gt;
                                                &lt;rb-container _nghost-c22="""" ng-reflect-row-data=""[object Object]"" ng-reflect-show-player=""true"" ng-reflect-show-search-bar=""true"" ng-reflect-include-edit=""true"" ng-reflect-include-delete=""true"" ng-reflect-include-stop=""false"" ng-reflect-include-sync=""false"" ng-reflect-include-checkbox=""true"" ng-reflect-include-fab-button=""true"" ng-reflect-route-type=""systemSetup"" ng-reflect-header=""Sites"" ng-reflect-mobile-table=""site"" ng-reflect-show-site-selector=""false"" ng-reflect-mobile-navigation=""true""&gt;
                                                    &lt;div _ngcontent-c22="""" class=""title-tab dn db-m mediumGreyColor pl4 pv2 overflow-auto""&gt;
                                                        &lt;h1 _ngcontent-c22="""" class=""header-text pa2 fl ng-star-inserted""&gt;Sites&lt;/h1&gt;&lt;/div&gt;
                                                    &lt;div _ngcontent-c22="""" class=""player-menu container overflow-auto dn db-m pv2 ng-star-inserted""&gt;
                                                      &lt;!-- [... player menu ...] --&gt;
                                                    &lt;/div&gt;
                                                    &lt;rb-fab-button _ngcontent-c22="""" class=""add-fab-button absolute dn db-m ng-star-inserted"" data-qaid=""create-button"" _nghost-c28=""""&gt;
                                                        &lt;button _ngcontent-c28="""" class=""w-10 z-1 mat-fab mat-accent"" mat-fab="""" type=""button"" ng-reflect-disabled=""false""&gt;&lt;span class=""mat-button-wrapper""&gt;&lt;mat-icon _ngcontent-c28="""" aria-label=""add"" class=""mat-icon material-icons ng-star-inserted"" role=""img"" aria-hidden=""true""&gt;add&lt;/mat-icon&gt;&lt;/span&gt;
                                                            &lt;div class=""mat-button-ripple mat-ripple mat-button-ripple-round"" matripple="""" ng-reflect-centered=""false"" ng-reflect-disabled=""false"" ng-reflect-trigger=""[object HTMLButtonElement]""&gt;&lt;/div&gt;
                                                            &lt;div class=""mat-button-focus-overlay""&gt;&lt;/div&gt;
                                                        &lt;/button&gt;
                                                    &lt;/rb-fab-button&gt;
                                                    &lt;div _ngcontent-c22="""" class=""mr4-l w-100-m""&gt;&lt;/div&gt;
                                                    &lt;rb-table-wrapper _ngcontent-c22="""" class=""dn db-m"" ng-reflect-row-data=""[object Object]"" ng-reflect-enable-sorting=""true"" ng-reflect-include-checkbox=""true"" ng-reflect-is-clickable=""false"" ng-reflect-row-selection=""multiple"" ng-reflect-dom-layout="""" ng-reflect-columns=""[object Object],[object Object"" ng-reflect-un-select-all_=""[object Object]"" ng-reflect-mobile-table=""site"" ng-reflect-mobile-navigation=""true"" ng-reflect-row-drag=""false"" ng-reflect-row-drag-field-name=""""&gt;
                                                        &lt;ag-grid-angular class=""ag-theme-material"" ng-reflect-grid-options=""[object Object]"" ng-reflect-row-data=""[object Object]"" ng-reflect-column-defs=""[object Object],[object Object"" ng-reflect-default-col-def=""[object Object]"" ng-reflect-row-selection=""multiple"" ng-reflect-suppress-row-click-selection=""true"" ng-reflect-enable-sorting=""true"" ng-reflect-enable-filter=""true"" ng-reflect-suppress-no-rows-overlay=""true"" ng-reflect-dom-layout="""" ng-reflect-row-drag-managed=""false""&gt;
                                                          &lt;!-- [... data grid ...] --&gt;
                                                        &lt;/ag-grid-angular&gt;
                                                        &lt;div class=""backgroundColor w-100 fixed bottom-0 left-0 dn db-m ng-star-inserted""&gt;
                                                            &lt;div class=""item-selection fr w-20""&gt;0/ 1 Selected&lt;/div&gt;
                                                        &lt;/div&gt;
                                                    &lt;/rb-table-wrapper&gt;
                                                    &lt;div _ngcontent-c22="""" class=""player-menu container overflow-auto db dn-m ng-star-inserted""&gt;&lt;/div&gt;
                                                &lt;/rb-container&gt;
                                            &lt;/div&gt;
                                        &lt;/div&gt;
                                    &lt;/rb-card&gt;
                                &lt;/div&gt;
                            &lt;/mat-drawer-content&gt;
                        &lt;/mat-drawer-container&gt;
                    &lt;/rb-site-tab&gt;
                &lt;/rb-system-setup&gt;
            &lt;/div&gt;
            &lt;div _ngcontent-c0="""" class=""snacks fixed mw6 rb-min-width-2""&gt;
                &lt;rb-global-snack-bar _ngcontent-c0="""" _nghost-c8="""" class=""ng-tns-c8-3""&gt;
                    &lt;div _ngcontent-c8="""" class=""snackBar""&gt;
                        &lt;ul _ngcontent-c8="""" class=""ma0 pa0 list""&gt;&lt;/ul&gt;
                    &lt;/div&gt;
                &lt;/rb-global-snack-bar&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/mat-drawer-content&gt;
&lt;/mat-drawer-container&gt;</code></pre>
</div>
</div>
</p>
",https://stackoverflow.com/questions/52174578/isdisplayed-returns-false-for-a-visible-element-in-protractor,"['javascript', 'html', 'css', 'protractor']",2351,TRUE,10,1
