title,body,link,tags,view_count,is_answered,score,answer_count
Protractor E2E testing: LoginPage,"<p>So, I am trying to test my login page using protractor e2e testing for my ionic app. This is my first time using protractor and I am having trouble understanding the error that I am getting.</p>

<blockquote>
  <p>Error:- Failed: no such element: Unable to locate element: {""method"":""css selector"",""selector"":""*[id=""user1""]""}</p>
</blockquote>

<p>I'm stuck, i just need guidance. It's my first time testing.</p>

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

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

browser.driver.get('http://url.path/login');


it('login page works', function() {
  // Checking the current url
  var currentUrl = browser.driver.getCurrentUrl();
  expect(currentUrl).toMatch('/login');
});

it('should sign in', function() {


// Find page elements
 var userNameField = browser.driver.findElement(by.id('username'));

 var userPassField = browser.driver.findElement(by.id('password'));
//  var userLoginBtn  = browser.driver.findElement(By.id('loginbtn'));

// Fill input fields
userNameField.sendKeys('nick@email.com');
userPassField.sendKeys('123456');

// Ensure fields contain what we've entered
// expect(userNameField.getAttribute('value')).toEqual('nick@email.com');
// expect(userPassField.getAttribute('value')).toEqual('123456');

// Click to sign in - waiting for Angular as it is manually bootstrapped.
// userLoginBtn.click();

return browser.driver.wait(function() {
      return browser.driver.getCurrentUrl().then(function(url) {
          return /success/.test(url);
      });
}, 10000);
});
});
</code></pre>

<p>Login.html:</p>

<pre><code>&lt;!--
  Generated template for the LoginPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
--&gt;
&lt;link href=""https://fonts.googleapis.com/css?family=Sacramento"" type=""text/css"" rel=""stylesheet""&gt;

&lt;ion-header&gt;

    &lt;ion-navbar transparent&gt;
      &lt;!--ion-title&gt;Login&lt;/ion-title--&gt;
    &lt;/ion-navbar&gt;

  &lt;/ion-header&gt;


  &lt;ion-content padding&gt;

    &lt;div class=""align""&gt;
        &lt;h1&gt;Atelier&lt;/h1&gt;
    &lt;/div&gt;

      &lt;ion-card&gt;
          &lt;ion-card-header&gt;
           Login
          &lt;/ion-card-header&gt;
          &lt;ion-card-content&gt;
             &lt;ion-list &gt;
               &lt;ion-item&gt;  
                   &lt;ion-input id=""username"" type=""email""      placeholder=""Email"" [(ngModel)]=""user.email""&gt;&lt;/ion-input&gt;
               &lt;/ion-item&gt;
               &lt;ion-item&gt;  
                   &lt;ion-input id =""password"" type=""password"" placeholder=""Password"" [(ngModel)]=""user.password""&gt;&lt;/ion-input&gt;
               &lt;/ion-item&gt;
              &lt;button  ion-button full clear color=""light"" (click)=""login(user)""&gt;Login&lt;/button&gt;
              &lt;button ion-button block round outline color=""light"" (click)=""register()""&gt;Register&lt;/button&gt;
             &lt;/ion-list&gt;    
          &lt;/ion-card-content&gt;
        &lt;/ion-card&gt;

  &lt;/ion-content&gt;

    &lt;style&gt;
      h1{
        font-size: 3em;
        text-align: center;
        font-family: Sacramento;
        font-style: cursive;
        color: white;
        text-shadow: 4px 4px 4px rgba(0,0,0,0.1); 
      }
  &lt;/style&gt;
</code></pre>

<p>app.po.ts:</p>

<pre><code>import { browser, by, element } from 'protractor';

export class LoginPage {
 navigateTo(){
  return browser.get('/login');
 }
 get usernameLabel() {
  return element(by.css('.login-field:nth-child(1) label'));
  }

 getEmailTextbox() {
  return element(by.id('username'));
 }
 get passwordLabel() {
  return element(by.css('.login-field:nth-child(2) label'));
  }
getPasswordTextbox() {
 return element(by.id('password'));
  }
  }

   export class Page {

   navigateTo(){
    return browser.get('/login');
      }

    getTitle() {
   return browser.getTitle();
    }

   getPageOneTitleText() {
   return element(by.tagName('page-page1')).element(by.tagName('ion-  title')).element(by.css('.toolbar-title')).getText();
     }

  goToLoginPage(): any{
   let LoginPage = require(""../src/pages/login/login"").default;
   return new LoginPage();
  }

 getUser(){
   return element(by.id('username'))
 }

  getPass(){
   return element(by.id('password'))
   }

 }
</code></pre>
",https://stackoverflow.com/questions/55878098/protractor-e2e-testing-loginpage,"['angular', 'typescript', 'ionic-framework', 'protractor', 'e2e-testing']",589,False,1,1
ReactJS + Cypress E2E testing,"<p>a quick question for anyone with React + Cypress experience - writing my first set of E2E tests and here's whats bugging me :</p>

<pre><code>cy.visit('http://movinito.docker.localhost:3000/company/subcontractors');
</code></pre>

<p>works, but</p>

<pre><code>cy.visit('/company/subcontractors');
</code></pre>

<p>doesn't work as expected (redirects me to the dashboard after login and stays there when I try to assert a pathname includes 'subcontractors').</p>

<p>my baseUrl in the cypress.json is</p>

<pre><code>{""baseUrl"": ""http://react_frontend.movinito.docker.localhost:3000""}
</code></pre>

<p>and it generally works (in case that was what you suspected).</p>

<p>I would like to use the shorter, nicer version <code>cy.visit('/company/subcontractors');</code> instead of the long winded retype of the baseUrl...</p>

<p>Might be important to add that prior to the .visit I use a</p>

<pre><code>cy.request('POST', 'http://movinito.docker.localhost/user/login?_format=json', {name,pass});
</code></pre>

<p>to [successfully] log in... As I said the whole thing works but I can't make use of the baseUrl and have to use the .visit command with the full environement based url...</p>

<p>Here is the [working] full test code</p>

<pre><code>   describe('Subcontractors section', ()=&gt; {
        it('renders properly', ()=&gt; {
            const { name, pass } = {name: 'info@batcave.com', pass: '123#456'}

            cy.request('POST', 'http://movinito.docker.localhost/user/login?_format=json', {
                name,
                pass
            });

            cy.visit('http://movinito.docker.localhost:3000/company/subcontractors');
//    
// I want to replace the above line with cy.visit('/company/subcontractors')
//
            cy.location('pathname').should('include', '/company/subcontractors');
            cy.get('[data-cy=page-title]').should('have.text', 'Subcontractors');
        })
    });
</code></pre>
",https://stackoverflow.com/questions/55453740/reactjs-cypress-e2e-testing,"['reactjs', 'e2e-testing', 'cypress']",363,True,1,1
e2e Testing bootstrap select picker,"<p>bootstrap selectpicker generates some elements so that protractor has to click a button to show the list of options (that are in the hidden select) and then click the item in the list. I'm having trouble figuring out, by text which list item needs to click.</p>

<p>Sample HTML looks like this:</p>

<pre><code>&lt;div&gt;
    &lt;button type=""button""&gt;
        &lt;div class=""ripple-container""&gt;&lt;/div&gt;
    &lt;/button&gt;
    &lt;div class=""dropdown-menu open"" role=""combobox""&gt;
        &lt;ul class=""dropdown-menu inner"" role=""listbox""&gt;
            &lt;li data-original-index=""1""&gt;&lt;a&gt;Male&lt;/a&gt;&lt;/li&gt;
            &lt;li data-original-index=""2""&gt;&lt;a&gt;Female&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
    &lt;select&gt;
        &lt;option&gt; &lt;/option&gt;
        &lt;option value=""MALE""&gt;Male&lt;/option&gt;
        &lt;option value=""FEMALE""&gt;Female&lt;/option&gt;
    &lt;/select&gt;
&lt;/div&gt;
</code></pre>

<p>I want to be able to tell protractor to click the li that corresponds to the option with the value <code>FEMALE</code> - because of localization, I don't want to hardcode strings, but rather find out the position of the option with the value <code>FEMALE</code> and use that to select the <code>&lt;li data-original-index=""2""&gt;</code></p>

<p>Is this even possible? Is there another, better way to do it?</p>
",https://stackoverflow.com/questions/54024469/e2e-testing-bootstrap-select-picker,"['protractor', 'bootstrap-selectpicker']",61,False,0,0
e2e testing a microservice in Nest,"<p>I'm attempting to write e2e tests for a microservice in Nest.  I think I've got my ProxyClient created properly in order to do requests to the service.</p>

<p>What I'm trying to do in my tests:</p>

<ol>
<li>Create a proxy client</li>
<li>Send a message using that client</li>
<li>Have them message be picked up by the service</li>
<li>Return the result of the message processing done by the service</li>
</ol>

<p>Here's what I have so far...it seems like it's close but I keep seeing this when I run my tests.</p>

<blockquote>
  <p>Expected: true, 
      Received: {""_isScalar"": false, ""operator"": {""concurrent"": Infinity, ""project"": [Function anonymous]}, ""source"": {""_isScalar"": false, ""_subscribe"": [Function anonymous]}}</p>
</blockquote>

<pre><code>import { Inject } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import { ClientsModule, Transport, ClientProxy } from '@nestjs/microservices';
import * as request from 'supertest';
import { HeartbeatModule } from './../src/heartbeat.module';
import { HeartbeatService } from './../src/heartbeat.service';


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

  beforeEach(async () =&gt; {
    const moduleFixture: TestingModule = await Test.createTestingModule({
      imports: [HeartbeatModule, ClientsModule.register([{ name: 'HEARTBEAT_SERVICE', transport: Transport.TCP }])],
    }).compile();

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

    client = app.get('HEARTBEAT_SERVICE');
    await client.connect();
  });

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

  it('sends a level 1 heartbeat message to the HeartbeatService', async () =&gt; {
    const response = client.send({""cmd"": ""heartbeat""}, {""type"": 1});

    expect(response).toBe(true);
  });
});
</code></pre>
",https://stackoverflow.com/questions/57315466/e2e-testing-a-microservice-in-nest,"['typescript', 'microservices', 'e2e-testing', 'nestjs']",6860,True,4,1
Angular CLI E2E Testing Wrong ChromeDriver,"<p>I am using the angular CLI. I created it with:</p>

<pre><code>ng new MyFirstApp
</code></pre>

<p>I then tried to run the end to end tests with:</p>

<pre><code>ng e2e
</code></pre>

<p>I got the following error message:</p>

<pre><code>E/launcher - session not created: This version of ChromeDriver only supports Chrome version 79
Driver info: chromedriver=79.0.3945.16

at Object.checkLegacyResponse (C:\TestProj\Angular\MyFirstApp\node_modules\selenium-webdriver\lib\error.js:546:15)
    at parseHttpResponse (C:\TestProj\Angular\MyFirstApp\node_modules\selenium-webdriver\lib\http.js:509:13)
    at C:\TestProj\Angular\MyFirstApp\node_modules\selenium-webdriver\lib\http.js:441:30
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
From: Task: WebDriver.createSession()
    at Function.createSession (C:\TestProj\Angular\MyFirstApp\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
    at Function.createSession (C:\TestProj\Angular\MyFirstApp\node_modules\selenium-webdriver\chrome.js:761:15)
    at Direct.getNewDriver (C:\TestProj\Angular\MyFirstApp\node_modules\protractor\built\driverProviders\direct.js:77:33)
    at Runner.createBrowser (C:\TestProj\Angular\MyFirstApp\node_modules\protractor\built\runner.js:195:43)
    at C:\TestProj\Angular\MyFirstApp\node_modules\protractor\built\runner.js:339:29
    at _fulfilled (C:\TestProj\Angular\MyFirstApp\node_modules\q\q.js:834:54)
    at C:\TestProj\Angular\MyFirstApp\node_modules\q\q.js:863:30
    at Promise.promise.promiseDispatch (C:\TestProj\Angular\MyFirstApp\node_modules\q\q.js:796:13)
    at C:\TestProj\Angular\MyFirstApp\node_modules\q\q.js:556:49
    at runSingle (C:\TestProj\Angular\MyFirstApp\node_modules\q\q.js:137:13)
</code></pre>

<p>The problem seems to be that I am on a computer where the chrome version is restricted and is at chrome 78 while angular is using chrome 79. I need some way of telling angular to use the driver for chrome 78. I tried doing this with setting the version with webdriver-manager but that didn't work. This module isn't even in my packages.json anyway. </p>

<p>See what I tried:</p>

<pre><code>npm install webdriver-manager -g
webdriver-manager update --version.chrome=78.0.3904.108
ng e2e --webdriver-update=false

</code></pre>

<p>How do I make this error go away? Thanks for any help you can provide.</p>

<p>Here is my versioning information:</p>

<ul>
<li>Operating System: Windows 10 </li>
<li>Node: 12.13.1 </li>
<li>NPM: 6.13.2 </li>
<li>Angular: 8.2.14 </li>
<li>Angular CLI: 8.3.21</li>
</ul>

<p>Here is my packages.json:</p>

<pre><code>{
  ""name"": ""my-first-app"",
  ""version"": ""0.0.0"",
  ""scripts"": {
    ""ng"": ""ng"",
    ""start"": ""ng serve"",
    ""build"": ""ng build"",
    ""test"": ""ng test"",
    ""lint"": ""ng lint"",
    ""e2e"": ""ng e2e""
  },
  ""private"": true,
  ""dependencies"": {
    ""@angular/animations"": ""~8.2.14"",
    ""@angular/common"": ""~8.2.14"",
    ""@angular/compiler"": ""~8.2.14"",
    ""@angular/core"": ""~8.2.14"",
    ""@angular/forms"": ""~8.2.14"",
    ""@angular/platform-browser"": ""~8.2.14"",
    ""@angular/platform-browser-dynamic"": ""~8.2.14"",
    ""@angular/router"": ""~8.2.14"",
    ""rxjs"": ""~6.4.0"",
    ""tslib"": ""^1.10.0"",
    ""zone.js"": ""~0.9.1""
  },
  ""devDependencies"": {
    ""@angular-devkit/build-angular"": ""~0.803.21"",
    ""@angular/cli"": ""~8.3.21"",
    ""@angular/compiler-cli"": ""~8.2.14"",
    ""@angular/language-service"": ""~8.2.14"",
    ""@types/node"": ""~8.9.4"",
    ""@types/jasmine"": ""~3.3.8"",
    ""@types/jasminewd2"": ""~2.0.3"",
    ""codelyzer"": ""^5.0.0"",
    ""jasmine-core"": ""~3.4.0"",
    ""jasmine-spec-reporter"": ""~4.2.1"",
    ""karma"": ""~4.1.0"",
    ""karma-chrome-launcher"": ""~2.2.0"",
    ""karma-coverage-istanbul-reporter"": ""~2.0.1"",
    ""karma-jasmine"": ""~2.0.1"",
    ""karma-jasmine-html-reporter"": ""^1.4.0"",
    ""protractor"": ""~5.4.0"",
    ""ts-node"": ""~7.0.0"",
    ""tslint"": ""~5.15.0"",
    ""typescript"": ""~3.5.3""
  }
}
</code></pre>
",https://stackoverflow.com/questions/59515800/angular-cli-e2e-testing-wrong-chromedriver,"['angular', 'protractor', 'selenium-chromedriver', 'angular-cli', 'angular-cli-v8']",2689,True,3,3
Filereplacements not working for e2e testing,"<p>I want to pick file <code>src/enironments/environment.docker.ts</code> when I run a dockerized version of my e2e testing.</p>

<p>I have added a new e2e section to angular.json</p>

<pre><code>""myapp-e2e"": {
   ...
},
""myapp-e2e-docker"": {
  ""root"": ""e2e"",
  ""sourceRoot"": ""e2e"",
  ""projectType"": ""application"",
  ""architect"": {
    ""e2e"": {
      ""builder"": ""@angular-devkit/build-angular:protractor"",
      ""options"": {
        ""protractorConfig"": ""./protractor.conf.js"",
        ""devServerTarget"": ""myapp:serve:docker""
      }
    }
  }
</code></pre>

<p>I have added a configuration to my serve section:</p>

<pre><code>    ""serve"": {
      ""builder"": ""@angular-devkit/build-angular:dev-server"",
      ""options"": {
        ""browserTarget"": ""myapp:build""
      },
      ""configurations"": {
        ""production"": {
          ""browserTarget"": ""myapp:build:production""
        },
        ""docker"": {
          ""browserTarget"": ""myapp:build:docker""
        }
      }
    }
</code></pre>

<p>And a configuration to my build section:</p>

<pre><code>        ""docker"": {
          ...
          ""fileReplacements"": [
            {
              ""replace"": ""src/environments/environment.ts"",
              ""with"": ""src/environments/environment.docker.ts""
            }
          ]
        }
</code></pre>

<p>Then I invoke my e2e conf like so</p>

<blockquote>
  <p>ng e2e myapp-e2e-docker</p>
</blockquote>

<p>It seem to do what I expect. If, for example, I misspell the name of the environment.docker.ts file it will complain that it can not find it. But then, reading the content of the environment at run-time, I always find the values from <code>src/environments/environment.ts</code></p>

<p>Is this some kind of bug? It looks like that the features for the <code>ng serve</code> facility are not available for the <code>ng e2e</code>.</p>

<p>My package.json file:</p>

<pre><code>""devDependencies"": {
  ""@angular-devkit/build-angular"": ""0.12.1"",
  ""@angular/language-service"": ""6.1.0"",
  ""@types/jasmine"": ""3.0.0"",
  ""@types/jasminewd2"": ""2.0.6"",
  ""@types/node"": ""6.0.60"",
  ""codelyzer"": ""4.2.1"",
  ""jasmine-core"": ""3.3.0"",
  ""jasmine-spec-reporter"": ""4.2.1"",
  ""karma"": ""3.1.1"",
  ""karma-chrome-launcher"": ""2.2.0"",
  ""karma-cli"": ""1.0.1"",
  ""karma-coverage-istanbul-reporter"": ""2.0.4"",
  ""karma-jasmine"": ""2.0.1"",
  ""karma-jasmine-html-reporter"": ""1.4.0"",
  ""protractor"": ""5.3.0"",
  ""ts-node"": ""7.0.1"",
  ""tslint"": ""5.3.2"",
  ""typescript"": ""2.9.2""
}
</code></pre>
",https://stackoverflow.com/questions/54400450/filereplacements-not-working-for-e2e-testing,"['node.js', 'angular-cli', 'angular-e2e']",2112,True,1,1
Nestjs e2e testing with mocking mongoose model,"<p>I am writing end to end test for my NestJS + mongoose application with supertest. I am able to mock mongoose apis such as <code>find()</code>, <code>delete()</code> etc.
But with mongoose <code>save()</code> api, for code <code>this.CatModel(CatObject)</code>, mocking is not working. I dont have mongodb for test system, so I need to mock it.</p>

<h3>cat.e2e-spec.ts</h3>

<pre class=""lang-js prettyprint-override""><code>describe('cat apis', () =&gt; {
    let app: INestApplication;

    beforeAll(async () =&gt; {
    const module = await Test.createTestingModule({
        imports: [CatModule]
    })
    .overrideProvider(getModelToken('Cat'))
    .useValue(mockCatModel)
    .compile();

    app = module.createNestApplication();
      server = app.getHttpServer();
      await app.init();
    });

    it(`POST /cat `, async () =&gt; {
        return await request(server)
            .post('/cat')
            .send(newCatPayload)
            .set('Accept', 'application/json')
            .expect(201)
            .expect(({ body }) =&gt; {
                expect(body).toEqual(expectedResponse);
            });
    });
});
</code></pre>

<h3>catModel.ts</h3>

<pre class=""lang-js prettyprint-override""><code>export const mockCatModel = {
    find: (obj) =&gt; {
        return [catMock];
    },

    save : (cat) =&gt; {
        return cat;
    }
};
</code></pre>

<h3>cat.service.ts</h3>

<pre class=""lang-js prettyprint-override""><code>public async createCat(catObject: CreateCatDto, user): Promise&lt;ICat&gt; {
    const oCat = this.catModel(catObject);
    oCat.user = user;
    return await oCat.save();
}
</code></pre>

<p><code>this.catModel.find()</code> works fine but, <code>this.catModel()</code> throws Error: 
        <code>'this.catModel is not a function'</code>.</p>

<p>I tried in <em>catModel.ts</em>, adding below function,</p>

<pre class=""lang-js prettyprint-override""><code>function : (a) =&gt; {return a;}
</code></pre>

<p>but did not work. Please help if anyone knows how to mock <code>this.catModel(catObject)</code>.</p>
",https://stackoverflow.com/questions/56475855/nestjs-e2e-testing-with-mocking-mongoose-model,"['mongoose', 'jestjs', 'e2e-testing', 'nestjs', 'supertest']",2364,True,0,1
How to remove focus in stenciljs E2E testing,"<p>In end-to-end testing using newE2EPage from stenciljs you can invoke focus() on an element to set focus on the element:</p>

<pre><code>   const page = await newE2EPage({html: `&lt;my-component&gt;&lt;/my-component&gt;`});
   const el = await page.find('my-component');
   await el.focus();
</code></pre>

<p>How do you remove focus from the element?</p>

<p>P.S. I've tried setting focus on a second element but this does not seem to work.</p>

<p>P.P.S. page.find() is how you do querySelector on an E2EPage from Stencil newE2EPage.  Documentation is at: <a href=""https://stenciljs.com/docs/end-to-end-testing#find-an-element-in-the-shadow-dom"" rel=""nofollow noreferrer"">https://stenciljs.com/docs/end-to-end-testing#find-an-element-in-the-shadow-dom</a></p>
",https://stackoverflow.com/questions/56926816/how-to-remove-focus-in-stenciljs-e2e-testing,"['javascript', 'puppeteer', 'e2e-testing', 'stenciljs']",617,True,1,1
StencilJS E2E testing: How do you dispatch a custom event?,"<p>How do you dispatch a CustomEvent to an element in StencilJS E2E testing:</p>

<pre><code>const page = await newE2EPage({html: `&lt;my-component&gt;&lt;/my-component&gt;`});
let component = await page.find('my-component');

?? component.dispatch(new Event('my-event'));
</code></pre>

<p>In the code above I'm trying to dispatch a customEvent to my component so I can test to see it responds correctly.  But I do not see any way of doing this in newE2EPage.  Any suggestions?</p>
",https://stackoverflow.com/questions/57421937/stenciljs-e2e-testing-how-do-you-dispatch-a-custom-event,"['typescript', 'web-component', 'e2e-testing', 'stenciljs']",1356,True,2,1
How to populate a MongoDB database for e2e testing effectively,"<p>I have set up my environments as described here: <a href=""https://medium.com/developer-circles-lusaka/how-to-write-an-express-js-server-using-test-driven-development-921dc55aec07"" rel=""nofollow noreferrer"">https://medium.com/developer-circles-lusaka/how-to-write-an-express-js-server-using-test-driven-development-921dc55aec07</a></p>

<p>This means I am using the config package to select an environment.</p>

<p>What I would like to do is (re-)populate the database before each test is performed. I am expecting this can be done using the beforeEach() hook Mocha provides (I am using Mocha as a test runner).</p>

<p>My question is to what is an effective way of loading a bunch of data into the database all at once (I am using Mongoose in case that makes a difference. I do not know if I can omit that when inserting)? Preferably this is done in a separated file from the test.</p>
",https://stackoverflow.com/questions/58799784/how-to-populate-a-mongodb-database-for-e2e-testing-effectively,"['javascript', 'mongodb', 'express', 'mocha.js', 'e2e-testing']",596,True,1,1
e2e testing in a nest js with prisma graphql api,"<p>I created a nest js with prisma graphql api. How can i create and run some e2e testing for my api. It would be ideal if i could run my tests against my staging db. Beneath is a starting point i have. But i am not sure where i need to define my prisma service and how i can use it inside my tests.</p>

<pre><code> beforeEach(async () =&gt; {
        const moduleFixture: TestingModule = await Test.createTestingModule({
          imports: [
            UserModule,
            GraphQLModule.forRoot({
              autoSchemaFile: 'src/schema.graphql',
            }),
          ],
        }).compile();

        app = moduleFixture.createNestApplication();
        await app.init();
      });
</code></pre>

<p>Kind regards,</p>

<p>Gerry</p>
",https://stackoverflow.com/questions/59221901/e2e-testing-in-a-nest-js-with-prisma-graphql-api,"['node.js', 'graphql', 'nestjs', 'prisma']",1720,False,0,1
Protractor e2e testing with Keycloak server as token provider in Angular,"<p>I am new to protractor. Unable to test my component as I am unable to login to keycloak server from my startup test file <code>e2e/app.e2e-spec.ts</code> file.</p>

<p>I am using <a href=""https://www.npmjs.com/package/keycloak-angular"" rel=""nofollow noreferrer"">keycloak</a> server for authentication</p>

<p>In my <code>app.e2e-spec.ts</code></p>

<pre><code>import { AppPage } from './app.po';
var protractor = require('protractor');
require('../node_modules/protractor/jasminewd');
//var config = require('../settings.js').getConfig();
require('../src/assets/keycloak.json')
const config = {
  url:'http://localhost:5000/',
  user:'test',
  password:'test'
}
describe('login', function() {
  it('should login', function() {
    console.log(config);
    var ptor = protractor.getInstance();
    var driver = ptor.driver;

    var findByName = function(name) {
      return driver.findElement(protractor.By.name(name));
    };

    driver.get(config.url);
    findByName('username').sendKeys(config.user);
    findByName('password').sendKeys(config.password);
    findByName('login').click();

  });
});
</code></pre>

<p>In my <code>keycloak.service.ts</code></p>

<pre><code>@Injectable()
export class KeycloakService {
  private instance: Keycloak.KeycloakInstance;
  private userProfile: Keycloak.KeycloakProfile;
  private bearerExcludedUrls: string[];
  private bearerPrefix: string;
  static auth: any = {};

  constructor(private settings:AppSettings){

  }
  init(): Promise&lt;any&gt; {
    let keycloakAuth = Keycloak('keycloak.json');//referring setting in json file
    this.instance = keycloakAuth;  
    KeycloakService.auth.loggedIn = false;
      return new Promise((resolve, reject) =&gt; {
        keycloakAuth.init({ onLoad: 'login-required' })
          .success(() =&gt; {
            KeycloakService.auth.loggedIn = true;
            resolve();
          })
          .error((e) =&gt; {
            reject();
          });
      });
    }

}
</code></pre>

<p>In my <code>component.ts</code> I need to login first to let my route open so I implemented
<code>APP_INITIALIZER</code> to get instance of component as below:</p>

<pre><code>    describe('AppDashboardComponent', () =&gt; {
    let component: AppDashboardComponent;
    let fixture: ComponentFixture&lt;AppDashboardComponent&gt;;
    let de: DebugElement;
    let el: HTMLElement;

    beforeEach(async(() =&gt; {
        TestBed.configureTestingModule({
            declarations: [
                AppDashboardComponent,
              ],
              imports: [
                  SharedModule,
                  ReactiveFormsModule,
                  HttpClientModule,
                  NGMaterialImportsModule,
                  CommonModule,
                  GrowlModule,
                  portfolioRouting
              ],
              providers: [KeycloakService,
                {
                  provide: _INITIALIZER,
                  useFactory: (config: KeycloakService) =&gt; 
                  () =&gt; config.init(),//This calls keycloak Init to goto login page
                  deps: [KeycloakService],
                  multi: true
                },
                ConfigService               
              ]
        })
    }))

    beforeEach(() =&gt; {
        fixture = TestBed.createComponent(AppDashboardComponent);
        component = fixture.componentInstance;
        de = fixture.debugElement.query(By.css('img'));
        el = de.nativeElement;
        // fixture.detectChanges();
    });

    it('should create', () =&gt; {
        expect(component).toBeTruthy();
    });
})
</code></pre>

<p>When I run <code>ng test</code> I get error ""<a href=""http://localhost:9876/keycloak.json"" rel=""nofollow noreferrer"">http://localhost:9876/keycloak.json</a> 404 (Not Found)"" as shown in below image.
How can I get around this issue so that I can login into external keycloak login page.</p>

<p><a href=""https://i.stack.imgur.com/3t33B.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/3t33B.png"" alt=""Karma error""></a></p>
",https://stackoverflow.com/questions/57336732/protractor-e2e-testing-with-keycloak-server-as-token-provider-in-angular,"['angular', 'protractor', 'karma-runner', 'keycloak']",916,False,3,0
&quot;No element found using locator...&quot; when performing e2e testing with cucumber,"<p>I get the folowing failure on several features of Cucumber ""NoSuchElementError: No element found using locator: By(css selector, h1)""</p>

<p>I have tried to set a bigger timeout in order to give Cucumber more time to find the elements, but it doesn't seem to work</p>

<p>Here are the main components of teh test:
cardTitle.feature:</p>

<pre><code>@cardTitle-feature
Feature: See card title
  Display the card title

  @cardTitle-scenario
  Scenario: Card Page
    Given I am on the card page
    When I do nothing
    Then I should see the card title
</code></pre>

<p>app.steps.ts:</p>

<pre><code>// Go to the card - Display the title
Given(/^I am on the card page$/, async () =&gt; {
    await page.navigateToCard();
});

When(/^I do nothing$/, () =&gt; {
});

Then(/^I should see the card title$/, async () =&gt; {
    expect(await page.getCardTitleText()).to.equal('Profile');
});
</code></pre>

<p>app.po.ts:</p>

<pre><code>navigateToCard() {
        this.sleep(3000);
        return browser.get('/card');
    }

getCardTitleText() {
        this.sleep(3000);
        return element(by.css('h1')).getText();
    }
</code></pre>

<p>card.html:</p>

<pre><code>&lt;div class=""profile-container""&gt;
  &lt;!-- EXAMPLE TOP NAV --&gt;

  &lt;h1&gt;Profile&lt;/h1&gt;
...
</code></pre>

<p>I think that this could happen because ""card"" may not be accessible without login in the application. If this is the problem, how could I perform a test that logs into the application and then checks the ""h1"" element?
Thank you!</p>
",https://stackoverflow.com/questions/55554756/no-element-found-using-locator-when-performing-e2e-testing-with-cucumber,"['javascript', 'protractor', 'cucumber']",881,True,1,1
"Unit and e2e testing with NestJS, TypeORM on Mysql and Passport module","<p>I'm currently taking over a backend written with NestJS, typeorm on Mysql and passport package for authentication. I'm currently trying to write both unit and e2e tests according to the NestJS documentation but I can't really make it work.</p>

<p>I've tried both importing the root AppModule or a single module. 
In the first case, it complains that it cannot connect to the database. I've overridden the configs provider for that, made it work on a testing Sqlite database, still passport module will raise an error saying that cannot access property challenge of undefined.</p>

<p>So, let's start with e2e testing, here is my app module:</p>

<pre><code>
  imports: [
    ConfigModule,
    CoreModule,
    Logger,
    AuthModule,
    TypeOrmModule.forRootAsync({
      imports: [TypeOrmConfigService],
      useClass: TypeOrmConfigService,
    }),
    UsersModule,
    CoreModule,
    DataModule,
    InitializationModule,
    TokensModule,
    ProjectsModule,
    ReportsModule,
    AccountsModule,
    NotificationModule,
    FaqModule,
    StrategicModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
</code></pre>

<p>and here is my e2e-spec file in which i override the config service to setup a temporary database:</p>

<pre><code>class MockTypeOrmConfigService implements TypeOrmOptionsFactory {
  createTypeOrmOptions(): TypeOrmModuleOptions {
    return {
      type: 'sqlite' as any,
      database: ':memory:',
      synchronize: true,
      dropSchema: true,
      entities: [`../src/**/*.entity{.ts,.js}`],
    };
  }
}
const mockTypeOrmConfigService = new MockTypeOrmConfigService();

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

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

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

  it('/faq (GET)', () =&gt; {
    return request(app.getHttpServer())
      .get('/faq')
      .expect(200)
      .expect('Hello World!');
  });
});
</code></pre>

<p>this would actually work if only a big part of my schema definition is based on mysql fields (for example json, composite autoincrement and blobs). 
So my next tentative would be to use single controller modules to create the app and run e2e tests there. 
Let's say I have this controller:</p>

<pre><code>@Controller('faq')
@UseGuards(AuthGuard())
@ApiBearerAuth()
export class FaqController {
  constructor(private readonly faqService: FaqService) {}

  @Get()
  @ApiOkResponse({ type: FaqEntryDto, isArray: true })
  async getAll(): Promise&lt;FaqEntryDto[]&gt; {
    return this.faqService.findAll();
  }

  @Post()
  @UseGuards(new RolesGuard(UserRole.Admin))
  async create(@Body() body: FaqEntryDto) {
    return this.faqService.create(body);
  }

  @Put('/:id')
  @UseGuards(new RolesGuard(UserRole.Admin))
  async update(
    @Param('id', new ParseIntPipe()) id: number,
    @Body() body: FaqEntryDto
  ) {
    return this.faqService.update(id, body);
  }

  @Delete('/:id')
  @UseGuards(new RolesGuard(UserRole.Admin))
  async delete(@Param('id', new ParseIntPipe()) id: number) {
    return this.faqService.delete(id);
  }
}
</code></pre>

<p>and this my test (in which I also override the repository provider:</p>

<pre><code>ntroller (e2e)', () =&gt; {
  let app: INestApplication;

  beforeAll(async () =&gt; {
    const moduleFixture = await Test.createTestingModule({
      imports: [FaqModule],
      providers: [FaqService],
    })
      .overrideProvider(getRepositoryToken(FaqEntity))
      .useValue({})
      .compile();

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

  it('/ (GET)', () =&gt; {
    return request(app.getHttpServer())
      .get('/faq')
      .expect(200)
      .expect('Hello World!');
  });
});
</code></pre>

<p>then, I would always get messages from the passport auth module, for instance:</p>

<pre><code>[Nest] 4976   - 8/29/2019, 8:27:00 AM   [ExceptionHandler] In order to use ""defaultStrategy"", please, ensure to import PassportModule in each place where AuthGuard() is being used. Otherwise, passport won't work correctly.
[Nest] 4976   - 8/29/2019, 8:27:00 AM   [ExceptionHandler] Cannot read property 'challenge' of undefined +44ms
TypeError: Cannot read property 'challenge' of undefined
</code></pre>

<p>I also tried with <code>overrideGuard</code> on <code>AuthGuard</code> but the result is exactly the same.</p>

<p>Additionally I would like to use typeorm-fixture package but also on this front I'm having big trouble.</p>
",https://stackoverflow.com/questions/57695246/unit-and-e2e-testing-with-nestjs-typeorm-on-mysql-and-passport-module,"['javascript', 'node.js', 'passport.js', 'nestjs', 'typeorm']",5623,True,1,1
Setting up database for e2e testing fails: E11000 duplicate key error collection,"<p>I am having some troubles trying to set up a database for testing purposes. The data stored in the database should be removed an re-populated for each test. I am currently doing the following:</p>

<p><em>db.js</em></p>

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

// a Mongoose model describing an entity
const Entity = require('entity-model');

// entities.mock is an array containing entity objects.
const mockedEntities= require('./entities.mock');

function setUp() {
  Entities.collection.insertMany(mockedEntities);
}

function breakDown() {
  mongoose.connection.on('connected', () =&gt; {
    mongoose.connection.db.dropDatabase();
  });
}

module.exports = { setUp, breakDown };
</code></pre>

<p>Then in my <em>test.js</em>:</p>

<pre><code>const db = require('./db');

describe('e2e tests to make sure all endpoints return the correct data from the database', () =&gt; {
  beforeEach(async () =&gt; {
    await db.breakDown();
    db.setUp();
  });

  it('should check store-test-result (UR-101)', (done) =&gt; ...perform test);
  it('should check store-nirs-device (UR-102)', (done) =&gt; ...perform test);
});
</code></pre>

<p>It seems like I am not emptying out the database before re-populating it correctly. Any advise as to what could be the cause?</p>
",https://stackoverflow.com/questions/58875857/setting-up-database-for-e2e-testing-fails-e11000-duplicate-key-error-collection,"['javascript', 'node.js', 'mongodb', 'mongoose', 'chai']",195,True,0,1
How to create a Kubernetes cluster from within GitLab CI for e2e testing?,"<p>I want to create a Google Cloud Kubernetes cluster programmatically in a GitLab CI script <code>.gitlab-ci.yml</code> in order to do e2e testing against it. Therefore I</p>

<ul>
<li>created a separate project <code>project-e2e</code> (in order to separate the billing)</li>
<li>enabled Kubernetes Engine API</li>
<li>created a service account <code>gitlab-ci@project-e2e.iam.gserviceaccount.com</code> with a key in JSON format which I'm providing through CI variables and using as shown below</li>
<li>made the service account <code>App Engine Admin</code>, <code>Compute Admin</code>, <code>Kubernetes Engine Admin</code>, <code>Kubernetes Engine Cluster Admin</code>, <code>Editor</code>, <code>Service Account User</code> and <code>Owner</code> following permission-role mappings described at <a href=""https://cloud.google.com/kubernetes-engine/docs/reference/api-permissions"" rel=""nofollow noreferrer"">https://cloud.google.com/kubernetes-engine/docs/reference/api-permissions</a> and <a href=""https://cloud.google.com/compute/docs/access/iam"" rel=""nofollow noreferrer"">https://cloud.google.com/compute/docs/access/iam</a></li>
</ul>

<p>The script however fails due to missing permissions of the created service account which should be covered by the assigned roles by as far as I understand (the output contains the commands the stage in the CI script consists of):</p>

<pre><code>$ echo ""$GOOGLE_KEY"" &gt; key.json
$ gcloud config set project project-e2e
Updated property [core/project].
$ gcloud auth activate-service-account --key-file key.json --project project-e2e
Activated service account credentials for: [gitlab-ci@project-e2e.iam.gserviceaccount.com]
$ gcloud config set compute/zone us-central1-a
Updated property [compute/zone].
$ kubectl config get-contexts
CURRENT   NAME   CLUSTER   AUTHINFO   NAMESPACE
$ gcloud container clusters create project-e2e-$CI_COMMIT_SHORT_SHA --project project-e2e --service-account=gitlab-ci@project-e2e.iam.gserviceaccount.com
WARNING: In June 2019, node auto-upgrade will be enabled by default for newly created clusters and node pools. To disable it, use the `--no-enable-autoupgrade` flag.
WARNING: Starting in 1.12, new clusters will have basic authentication disabled by default. Basic authentication can be enabled (or disabled) manually using the `--[no-]enable-basic-auth` flag.
WARNING: Starting in 1.12, new clusters will not have a client certificate issued. You can manually enable (or disable) the issuance of the client certificate using the `--[no-]issue-client-certificate` flag.
WARNING: Currently VPC-native is not the default mode during cluster creation. In the future, this will become the default mode and can be disabled using `--no-enable-ip-alias` flag. Use `--[no-]enable-ip-alias` flag to suppress this warning.
WARNING: Starting in 1.12, default node pools in new clusters will have their legacy Compute Engine instance metadata endpoints disabled by default. To create a cluster with legacy instance metadata endpoints disabled in the default node pool, run `clusters create` with the flag `--metadata disable-legacy-endpoints=true`.
WARNING: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s). 
This will enable the autorepair feature for nodes. Please see https://cloud.google.com/kubernetes-engine/docs/node-auto-repair for more information on node autorepairs.
ERROR: (gcloud.container.clusters.create) ResponseError: code=403, message=Required ""container.clusters.create"" permission(s) for ""projects/project-e2e"". See https://cloud.google.com/kubernetes-engine/docs/troubleshooting#gke_service_account_deleted for more info.
</code></pre>

<p>I tried</p>

<ul>
<li>omitting <code>--service-account=gitlab-ci@project-e2e.iam.gserviceaccount.com</code> which has no effect</li>
<li>finding answers in <a href=""https://cloud.google.com/kubernetes-engine/docs/troubleshooting#gke_service_account_deleted"" rel=""nofollow noreferrer"">https://cloud.google.com/kubernetes-engine/docs/troubleshooting#gke_service_account_deleted</a> which seems unrelated</li>
<li>adding and omitting <code>--no-enable-legacy-authorization</code> which has no effect</li>
</ul>

<p><a href=""https://i.stack.imgur.com/QoHsI.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/QoHsI.png"" alt=""enter image description here""></a></p>
",https://stackoverflow.com/questions/57435082/how-to-create-a-kubernetes-cluster-from-within-gitlab-ci-for-e2e-testing,"['kubernetes', 'gitlab', 'gcloud', 'google-iam', 'google-cloud-iam']",220,False,4,0
Can i check whether access_token is issued or not in e2e Testing? (Protractor),"<p>I am new to e2e testing using protractor. I want to ask that while hitting a URL directly, Can we check whether access_token is issued or not? Is there any built-in functions in protractor that can help us manipulating the access_token. I have tried using <code>executeScript</code> but it didn't work. </p>

<p>What I am doing is to test certain functionalities in a component and then before moving to next component i want to check whether the user has access_token or not. If user has access_token he should be allowed to next component otherwise he should be directed to the login page for login</p>
",https://stackoverflow.com/questions/59486757/can-i-check-whether-access-token-is-issued-or-not-in-e2e-testing-protractor,"['angular', 'authentication', 'protractor', 'access-token', 'e2e-testing']",724,True,0,1
"How to wait for a slightly longer scheduler process to finish, while doing e2e testing","<p>How to wait for a slightly longer scheduler process to finish, while doing e2e testing</p>

<p>Hi,</p>

<p>I am automating an E2E scenario, where we put a request for report generation from web-UI.
The workflow is such that, after we click on Submit button for report generation.</p>

<p>A non-blocking process start to run &amp; in min or so it adds a new  in the results table below.</p>

<p>How to wait for such Event (i.e. for the record to get generated on top of existing records stack)?
I would like to avoid arbitrary <code>wait(400)</code> etc.
Bear in mind there might already be few rows in the table, where new row gets generated on top of existing.</p>

<p>Thanks</p>
",https://stackoverflow.com/questions/58117923/how-to-wait-for-a-slightly-longer-scheduler-process-to-finish-while-doing-e2e-t,['cypress'],98,True,2,1
&quot;Cannot assign to Service because it is not a variable&quot; using Angular 4 Testbed e2e testing,"<p>I am using Angular 4 with TestBed, as per the documents here: <a href=""https://angular.io/guide/testing#service-tests"" rel=""nofollow noreferrer"">https://angular.io/guide/testing#service-tests</a></p>

<p>I have a simple Service: </p>

<pre><code>@Injectable()
export class SimpleService {
  getValue() { return 'Hi'; }
}
</code></pre>

<p>And a test, which instantiates this Service using TestBed: </p>

<pre><code>describe('SimpleService', () =&gt; {
  beforeEach(() =&gt; {
    TestBed.configureTestingModule({ providers: [SimpleService] });
  });

  it('Should say Hello', () =&gt; {
    const testBedService: SimpleService = TestBed.get(SimpleService);
    const actual = testBedService.getValue();
    expect(actual).toBe('Hi');
  });
});
</code></pre>

<p>However, running this test with <code>ng e2e</code> gives me the following error: </p>

<pre><code>Cannot assign to 'SimpleService' because it is not a variable
</code></pre>

<p>What do I need to change? </p>
",https://stackoverflow.com/questions/54686167/cannot-assign-to-service-because-it-is-not-a-variable-using-angular-4-testbed,"['angular', 'unit-testing', 'protractor', 'e2e-testing', 'angular-e2e']",162,True,0,1
What can I use for mock fetch-requests while e2e testing in protractor similar to addMockModule without Angular,"<p>I am writing e2e test with protractor for a typescript module. I want to use protractor for the additional features in comparison to selenium webdriver. I am using typescript standalone so I am building a non-angular application.</p>

<p>I searched a lot for mocking services or fetchmock etc. But I think I am searching at the wrong place. Maybe I just didn't understood what do I really need for my problem.
At the moment I have an application where I want to test the frontend. My problem is, that the application only works with a server which is setting up many data and make it available for rest. Without this server my javascript file wont work and I wont start the server for my tests, it must be server independent.</p>

<p>For example: my server provide the data on a specific address 192.168.1.230 and I can fetch the data with fetch api over: 192.168.1.230/users/1.</p>

<p>In unit tests I have mocked my fetches, but in e2e tests I need to mock the address (maybe with selenium webdriver) and want to get a dummy response if my api is fetching this data.</p>

<p>How can I realise that? I use protractor with npm (nodejs) and could need a npm plugin for this.</p>

<p>I saw another post <a href=""https://stackoverflow.com/questions/28801800/logging-xhr-requests-while-doing-e2e-tests-with-protractor"">here</a> with the addMockModule, but this is only for angular modules and I don't use angular.</p>
",https://stackoverflow.com/questions/55340398/what-can-i-use-for-mock-fetch-requests-while-e2e-testing-in-protractor-similar-t,"['selenium-webdriver', 'mocking', 'protractor', 'fetch', 'e2e-testing']",267,False,1,0
How to check if a &lt;td&gt; element has got colspan attribute in Angular+Protractor e2e testing with typescript,"<p>How to check if a  element has got colspan attribute in Angular+Protractor e2e testing with typescript</p>

<p>i tried the following, but doesnt seems to be working</p>

<p><code>const colspan = await cols[0].getAttribute('colspan');</code></p>
",https://stackoverflow.com/questions/57809126/how-to-check-if-a-td-element-has-got-colspan-attribute-in-angularprotractor-e,"['angular', 'typescript', 'protractor']",161,False,0,1
How to trigger a click outside event?,"<p>I'm writing unit testing and e2e testing for a popover component in React.
I should check if the popup is hidden when I click outside the component.
I'm using Jest + Enzyme for unit testing and Cypress for e2e testing.
Does anybody know how to do this?</p>

<p>I've tried as follows in cypress.</p>

<pre><code>cy.get('[data-test-id=""popover-container""]').click(-20, -20, {force: true});
</code></pre>

<p>But the clicked point is actually outside of the popup window, but it doesn't work.
<code>react-tiny-popover</code> library is used to show the popover as follows:</p>

<pre><code>&lt;Popover
      content={({ position, targetRect, popoverRect }) =&gt; (
        &lt;ArrowContainer
          position={position}
          targetRect={targetRect}
          popoverRect={popoverRect}
          arrowColor={'#ccc'}
          arrowSize={10}
        &gt;
          &lt;div data-test-id=""popover-container""&gt;
            &lt;Content/&gt;
          &lt;/div&gt;
        &lt;/ArrowContainer&gt;
      )}
      isOpen={visible}
      onClickOutside={() =&gt; hideOnOutsideClick &amp;&amp; setVisible(false)}
      position={position}
    &gt;
      &lt;div onClick={() =&gt; setVisible(!visible)}&gt;{children}&lt;/div&gt;
    &lt;/Popover&gt;
</code></pre>
",https://stackoverflow.com/questions/58593525/how-to-trigger-a-click-outside-event,"['javascript', 'click', 'mouseevent', 'cypress']",19547,True,19,2
"Error code: 135 ,How to fix error: Could not find update-config.json. Run ‘webdriver-manager update’ to download binaries","<pre><code>[17:05:22] I/launcher – Running 1 instances of WebDriver 
[17:05:22] I/direct – Using ChromeDriver directly… [17:05:22] E/direct – Error code: 135  
[17:05:22] E/direct – Error message: Could not find update-config.json. Run ‘webdriver-manager update’ to download binaries.  
[17:05:22] E/direct – Error: Could not find update-config.json. Run ‘webdriver-manager update’ to download binaries. at Direct.getNewDriver (C:automationDemoprotractor-jasmine-typescriptnode_modulesprotractorbuiltdriverProvidersdirect.js:63:31)    at Runner.createBrowser (C:automationDemoprotractor-jasmine-typescriptnode_modulesprotractorbuiltrunner.js:195:43) at q.then.then (C:automationDemoprotractor-jasmine-typescriptnode_modulesprotractorbuiltrunner.js:339:29) at _fulfilled (C:automationDemoprotractor-jasmine-typescriptnode_modulesqq.js:834:54) at self.promiseDispatch.done (C:automationDemoprotractor-jasmine-typescriptnode_modulesqq.js:863:30) at Promise.promise.promiseDispatch (C:automationDemoprotractor-jasmine-typescriptnode_modulesqq.js:796:13) at C:automationDemoprotractor-jasmine-typescriptnode_modulesqq.js:556:49 at runSingle (C:automationDemoprotractor-jasmine-typescriptnode_modulesqq.js:137:13) at flush (C:automationDemoprotractor-jasmine-typescriptnode_modulesqq.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:131:7)  
[17:05:22] E/launcher – Process exited with error code 135 npm ERR! Test failed.  See above for more details. PS C:automationDemoprotractor-jasmine-typescript&gt;
</code></pre>

<p>getting this error at the time of debugging of e2e testing</p>
",https://stackoverflow.com/questions/57603481/error-code-135-how-to-fix-error-could-not-find-update-config-json-run-webdr,"['angular', 'selenium-webdriver', 'e2e-testing', 'angular-e2e']",6336,True,5,2
CircleCI - Option to continue deploying even if the exit code is 1 of one of the build steps,"<p>As part of our deployment pipeline we have some E2E testing by Cypress.
In case something failed over there because a flaky test case and not because of a real bug in the project code,</p>

<p>We are looking for some way to re-run the job again with option to skip on the E2E testing or to keep continue the deploying even this step is failed.</p>
",https://stackoverflow.com/questions/57052632/circleci-option-to-continue-deploying-even-if-the-exit-code-is-1-of-one-of-the,"['automation', 'continuous-integration', 'pipeline', 'cypress', 'circleci']",1650,False,1,0
How to mock a module method during detox testing?,"<p>I'm trying mock a module during detox e2e testing :</p>

<pre><code>  beforeEach(async () =&gt; {
    function mockFunctions() {
      const original = require.requireActual('react-native-device-info');
      return {
        ...original,
        getDeviceCountry: jest.fn(() =&gt; {
          return 'DE'
        })
      }
    }
    await jest.mock('react-native-device-info', () =&gt; mockFunctions)
  })

</code></pre>

<p>It's not working, so I'm wondering if it's even possible?</p>
",https://stackoverflow.com/questions/55620636/how-to-mock-a-module-method-during-detox-testing,"['javascript', 'react-native', 'detox']",268,False,3,0
"Basic concept of jasmine, protractor and mocha","<p>I am new to e2e testing. I'm using protractor for angular 4 testing. I am much confused about jasmine, mocha and protractor. My understanding with jasmine and protractor is that jasmine is a testing framework. <strong>It can not be used stand alone without any test runner</strong> i.e. protractor(e2e testing) or karma(unit testing).
<strong>Protractor is a test runner</strong> that uses jasmine framework. It interacts with browser, without protractor (or any other test runner), jasmine can't interact with browser in e2e testing.</p>

<p>On the other hand, mocha is also a testing framework that has its own test runner i.e. mocha-CLI. It doesn't need any test runner and can be used stand alone for testing.
Can any one help me in getting the right concept?</p>

<p>Thanks in advance</p>
",https://stackoverflow.com/questions/59450830/basic-concept-of-jasmine-protractor-and-mocha,"['angular', 'jasmine', 'protractor', 'mocha.js', 'e2e-testing']",741,True,1,1
Should e2e tests persist data in real databases?,"<p>I've been reading a lot about e2e testing and one thing I cannot understand is how ""real"" should e2e tests be.</p>

<p>Regardless of the tools I use for the e2e tests, I've seen that most of the time they hit either local, development or alpha environments.</p>

<p>If my application has authentication, should I create a ""test"" user with valid credentials in the database? Should I do that for Alpha or even Production environments? How else would this test user login into my application?</p>

<p>Say I have the infamous TODO app. I have a test that logs the user in. After logging in, I want to test that the user is able to create a TODO. This TODO is saved in a Database.   </p>

<p>After running the tests, should I run something to remove the data created during e2e tests? Or should I intercept the request just before saving it and mock the response (would this be an antipattern for e2e testing)? </p>
",https://stackoverflow.com/questions/55093017/should-e2e-tests-persist-data-in-real-databases,"['javascript', 'integration-testing', 'nightwatch.js', 'e2e-testing', 'cypress']",15044,True,34,4
How to check if a &lt;td&gt; element has got colspan attribute in Angular+Protractor e2e testing with typescript,"<p>How to check if a  element has got colspan attribute in Angular+Protractor e2e testing with typescript</p>

<p>i tried the following, but doesnt seems to be working</p>

<p><code>const colspan = await cols[0].getAttribute('colspan');</code></p>
",https://stackoverflow.com/questions/57809126/how-to-check-if-a-td-element-has-got-colspan-attribute-in-angularprotractor-e,"['angular', 'typescript', 'protractor']",161,False,0,1
ionic 4 protractor e2e - how to select/distinguish between ionic alerts buttons,"<p>I want to be able to simply and reliable select these two alert buttons for e2e testing with protractor.</p>

<p>I can't use by.partialButtonText since the text is inside a span element.</p>

<pre class=""lang-html prettyprint-override""><code>&lt;button type=""button"" class=""alert-button ion-focusable ion-activatable sc-ion-alert-md"" tabindex=""0""&gt;
     &lt;span class=""alert-button-inner sc-ion-alert-md""&gt;Yes&lt;/span&gt;
     &lt;ion-ripple-effect class=""sc-ion-alert-md md hydrated"" role=""presentation""&gt;&lt;/ion-ripple-effect&gt;
&lt;/button&gt;
&lt;button type=""button"" class=""alert-button ion-focusable ion-activatable sc-ion-alert-md"" tabindex=""0""&gt;
     &lt;span class=""alert-button-inner sc-ion-alert-md""&gt;No&lt;/span&gt;
     &lt;ion-ripple-effect class=""sc-ion-alert-md md hydrated"" role=""presentation""&gt;&lt;/ion-ripple-effect&gt;
&lt;/button&gt;


</code></pre>
",https://stackoverflow.com/questions/56760981/ionic-4-protractor-e2e-how-to-select-distinguish-between-ionic-alerts-buttons,"['protractor', 'ionic4', 'end-to-end']",279,True,0,1
How do we script/automate an Electron app with Puppeteer?,"<p>Is it possible? Is there a guide somewhere? Basically I'd like to do E2E testing of an Electron app, and will script user interactions, i.e. make a ""bot"" or ""puppet"" user that interacts inside the Electron app.</p>
",https://stackoverflow.com/questions/54896279/how-do-we-script-automate-an-electron-app-with-puppeteer,"['javascript', 'automation', 'electron', 'puppeteer', 'e2e-testing']",2561,True,5,1
Angular 7 unable to set id attribute to angular material mat-tab,"<p>I am trying to add id attribute to angular material mat-tab to find the element in e2e testing? I am unable to set it out?
Can anyone help me how to do this?</p>

<pre><code>&lt;mat-tab label=""custom"" class=""scroll-x"" id=""custom""&gt;
</code></pre>

<p>Thank</p>
",https://stackoverflow.com/questions/58024498/angular-7-unable-to-set-id-attribute-to-angular-material-mat-tab,"['angular-material', 'angular7']",2804,True,4,1
Frontend e2e test - how to detect google map is initialised on selenium?,"<p>I am doing frontend e2e testing using WebDriverIo(4.13.2) with CucumberJs.</p>

<p>And I am quite new to e2e testing.</p>

<p>My app uses Google map and there are map markers.</p>

<p>Basically, my e2e testing wants to do :</p>

<ul>
<li>Wait til Google map component initialised</li>
<li>Search Google map marker DOM by <code>browser</code> object from WebDriverIo</li>
<li>If the marker exist, pass the test</li>
</ul>

<p>The problem is that Google map's initialisation takes time.</p>

<p>Sometimes it takes more than 30 seconds on Selenium.
So the second scenario fails. (Timeout)</p>

<p>I have tried <code>browser.pause(30000);</code>. So Selenium waits 30 seconds. </p>

<p>But it still fails depends how Google Map response quickly.
Moreover I don't think waiting 30 seconds is an ideal solution.</p>

<p>The below is the test code.</p>

<p>My scenario is :</p>

<pre><code>...
Then I should see map
And I should see map marker
...
</code></pre>

<p>My step is :</p>

<pre><code>Then('I should see map', async () =&gt; {
  const path = 'my-page map-component';

  myPage.mapComponent.waitForShadowDomElement(path);

  // Wait for 30 seconds
  browser.pause(30000);
});

Then('I should see map marker', async () =&gt; {
  const path = 'my-page ${page}'

  // Get marker img src
  const marker = await browser.getAttribute(`${path} #map img[src*=""marker""] img`, 'src');

  assert.isTrue(marker.includes('marker-img.svg'));
});
</code></pre>

<p>I thought that <code>myPage.mapComponent.waitForShadowDomElement(path);</code> is not enough to wait Google map init because it waits just for the cover of map.</p>

<p>I also I have test like <code>browser.waitForVisible(MAP_PATH);</code>.</p>

<p>But no luck.</p>

<p><strong>How can I wait Google map completely being loaded on WebDriverIo?</strong></p>

<p>Thanks!!</p>

<p><em>FYI,
In frontend, I am using Polymer component which WebDriverIo can't detect.</em></p>

<p><em>So I am using 3rd party library called <a href=""https://github.com/Morlack/wdio-webcomponents"" rel=""nofollow noreferrer"">wdio-webcomponents</a>.</em></p>
",https://stackoverflow.com/questions/56049685/frontend-e2e-test-how-to-detect-google-map-is-initialised-on-selenium,"['selenium', 'google-maps', 'e2e-testing', 'cucumberjs', 'webdriver-io-v4']",506,False,0,1
Do I need a unit-testing framework if I&#39;m already using Cypress in a Vue.js app?,"<p>When scaffolding a new project with the Vue.js CLI, it offers a choice of both unit-testing and E2E-testing frameworks. </p>

<p>Unit-testing functionality is perfectly adequate in Cypress. My question, then: is there an advantage to using a distinct unit-testing framework if I'm already using Cypress?</p>
",https://stackoverflow.com/questions/54764650/do-i-need-a-unit-testing-framework-if-im-already-using-cypress-in-a-vue-js-app,"['unit-testing', 'vue.js', 'cypress', 'end-to-end']",1535,True,8,1
this.app.client.electron.remote.app.getApplicationMenu() returns undefined,"<p>I am working on setting up e2e testing for Electron app that has custom menus. I want to test these custom menus. I tried several ways to access 'getApplicationMenu()' from Spectron's Application client. But all of them return 'undefined'.</p>

<pre><code>this.app.client.electron.remote.app.getApplicationMenu()
</code></pre>
",https://stackoverflow.com/questions/56258401/this-app-client-electron-remote-app-getapplicationmenu-returns-undefined,"['electron', 'e2e-testing', 'spectron']",182,False,1,0
nativescript-dev-appium e2e test failed,"<p>I'm try to e2e testing with nativescript-dev-appium, but failed. I don't know what's wrong.
I'm coding with this link
<a href=""https://github.com/NativeScript/ns-dev-days-appium-plugin"" rel=""nofollow noreferrer"">https://github.com/NativeScript/ns-dev-days-appium-plugin</a></p>

<p>and this is android28</p>

<pre><code>""android28"": {
        ""platformName"": ""Android"",
        ""platformVersion"": ""28"",
        ""deviceName"": ""Emulator-Api28-Google"",
        ""avd"": ""Emulator-Api28-Google"",
        ""lt"": 60000,
        ""newCommandTimeout"": 720,
        ""noReset"": false,
        ""fullReset"": false,
        ""app"": """"
    }
</code></pre>

<blockquote>
  <p>$ npm run e2e -- --runType android28</p>
</blockquote>

<pre><code>@ e2e /appium-demo node ./node_modules/nativescript-dev-appium/check-dev-deps.js &amp;&amp;  tsc -p e2e  &amp;&amp;  mocha --opts ./e2e/config/mocha.opts  ""--runType"" ""android28""



    Parsed args:   {""port"":4723,""projectDir"":""/appium-demo"",""projectBinary"":""/appium-demo/node_modules/.bin"",""pluginRoot"":""/appium-demo/node_modules/nativescript-dev-appium"",""pluginBinary"":""/appium-demo/node_modules/nativescript-dev-appium/node_modules/.bin"",""wdaLocalPort"":8410,""testFolder"":""e2e"",""runType"":""android28"",""appiumCapsLocation"":""/appium-demo/e2e/config/appium.capabilities.json"",""verbose"":false,""cleanApp"":false,""path"":""/appium-demo"",""capabilitiesName"":""appium.capabilities.json"",""driverConfig"":{""host"":""localhost"",""port"":4723},""logImageTypes"":[]}


    /appium-demo/e2e/config/appium.capabilities.json
    Capabilities found at: /appium-demo/e2e/config/appium.capabilities.json 
    Automation name set to: UIAutomator2 
    To change automation name, you need to set it in appium capabilities!
    Available applications:  [""platforms/android/app/build/outputs/apk/debug/app-debug.apk""]
    Pick first application:   ""platforms/android/app/build/outputs/apk/debug/app-debug.apk""
    Application full path: /appium-demo/platforms/android/app/build/outputs/apk/debug/app-debug.apk 
      1) ""before all"" hook: start server
      2) ""after all"" hook: stop server

      0 passing (109ms)
      2 failing

  1) ""before all"" hook: start server:
     TypeError: Cannot read property 'sdk' of undefined
      at fs_1.readFileSync.split.forEach.line (node_modules/mobile-devices-controller/lib/android-controller.js:678:44)
      at Array.forEach (&lt;anonymous&gt;)
      at fs_1.readdirSync.filter.forEach.f (node_modules/mobile-devices-controller/lib/android-controller.js:671:18)
      at Array.forEach (&lt;anonymous&gt;)
      at Function.parseEmulatorsAvds (node_modules/mobile-devices-controller/lib/android-controller.js:668:14)
      at Function.&lt;anonymous&gt; (node_modules/mobile-devices-controller/lib/android-controller.js:862:57)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/node_modules/mobile-devices-controller/lib/android-controller.js:8:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (node_modules/mobile-devices-controller/lib/android-controller.js:4:12)
      at Function.parseEmulators (node_modules/mobile-devices-controller/lib/android-controller.js:856:16)
      at Function.&lt;anonymous&gt; (node_modules/mobile-devices-controller/lib/android-controller.js:46:37)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/node_modules/mobile-devices-controller/lib/android-controller.js:8:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (node_modules/mobile-devices-controller/lib/android-controller.js:4:12)
      at Function.getAllDevices (node_modules/mobile-devices-controller/lib/android-controller.js:42:16)
      at Function.&lt;anonymous&gt; (node_modules/mobile-devices-controller/lib/device-controller.js:242:63)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/node_modules/mobile-devices-controller/lib/device-controller.js:8:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (node_modules/mobile-devices-controller/lib/device-controller.js:4:12)
      at Function.mapDevicesToArray (node_modules/mobile-devices-controller/lib/device-controller.js:235:16)
      at Function.&lt;anonymous&gt; (node_modules/mobile-devices-controller/lib/device-controller.js:24:52)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/node_modules/mobile-devices-controller/lib/device-controller.js:8:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (node_modules/mobile-devices-controller/lib/device-controller.js:4:12)
      at Function.getDevices (node_modules/mobile-devices-controller/lib/device-controller.js:22:16)
      at DeviceManager.&lt;anonymous&gt; (node_modules/nativescript-dev-appium/lib/device-manager.js:41:86)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/node_modules/nativescript-dev-appium/lib/device-manager.js:7:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (node_modules/nativescript-dev-appium/lib/device-manager.js:3:12)
      at DeviceManager.startDevice (node_modules/nativescript-dev-appium/lib/device-manager.js:18:16)
      at Object.&lt;anonymous&gt; (node_modules/nativescript-dev-appium/lib/utils.js:491:44)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/node_modules/nativescript-dev-appium/lib/utils.js:7:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (node_modules/nativescript-dev-appium/lib/utils.js:3:12)
      at Object.exports.prepareDevice (node_modules/nativescript-dev-appium/lib/utils.js:489:50)
      at AppiumServer.&lt;anonymous&gt; (node_modules/nativescript-dev-appium/lib/appium-server.js:165:40)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/node_modules/nativescript-dev-appium/lib/appium-server.js:7:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (node_modules/nativescript-dev-appium/lib/appium-server.js:3:12)
      at AppiumServer.prepDevice (node_modules/nativescript-dev-appium/lib/appium-server.js:164:16)
      at AppiumServer.&lt;anonymous&gt; (node_modules/nativescript-dev-appium/lib/appium-server.js:55:28)
      at Generator.next (&lt;anonymous&gt;)
      at fulfilled (node_modules/nativescript-dev-appium/lib/appium-server.js:4:58)
      at process._tickCallback (internal/process/next_tick.js:68:7)

  2) ""after all"" hook: stop server:
     TypeError: Cannot read property 'platform' of undefined
      at Function.getApplicationId (node_modules/mobile-devices-controller/lib/device-controller.js:96:20)
      at Function.&lt;anonymous&gt; (node_modules/mobile-devices-controller/lib/device-controller.js:217:47)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/node_modules/mobile-devices-controller/lib/device-controller.js:8:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (node_modules/mobile-devices-controller/lib/device-controller.js:4:12)
      at Function.uninstallApplication (node_modules/mobile-devices-controller/lib/device-controller.js:216:16)
      at Object.&lt;anonymous&gt; (node_modules/nativescript-dev-appium/index.js:92:64)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/node_modules/nativescript-dev-appium/index.js:7:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (node_modules/nativescript-dev-appium/index.js:3:12)
      at Object.stopServer (node_modules/nativescript-dev-appium/index.js:84:12)
      at Context.&lt;anonymous&gt; (e2e/setup.js:33:41)
      at Generator.next (&lt;anonymous&gt;)
      at /home/mai/code/mobile_app/appium-demo/e2e/setup.js:7:71
      at new Promise (&lt;anonymous&gt;)
      at __awaiter (e2e/setup.js:3:12)
      at Context.&lt;anonymous&gt; (e2e/setup.js:32:12)
      at process.topLevelDomainCallback (domain.js:126:23)
</code></pre>
",https://stackoverflow.com/questions/58690011/nativescript-dev-appium-e2e-test-failed,"['android', 'testing', 'nativescript', 'system-testing']",136,False,0,1
React add data attribute to each render() with component name,"<p>To make e2e testing easier I would like to add to each <code>react</code> component <code>data-component=</code> attribute with component name. I would like to have it done ""automatically"" (without adjusting <code>render()</code> functions everywhere).</p>

<p>Anyone knows how to do it reliably for both class and function based components?</p>
",https://stackoverflow.com/questions/58835969/react-add-data-attribute-to-each-render-with-component-name,"['javascript', 'reactjs']",1669,True,3,2
React (Unit &amp; Integration): Which framework to use for react unit testing and Integration testing,"<p>I have just started with development in Reactjs. I am looking for testing framework(Javascript). Which can be used to do both ""Unit Testing"", ""Integration Testing"" and ""e2e testing"". </p>

<p>Please, help me if we can do the the required testing using Javascript.</p>
",https://stackoverflow.com/questions/57039857/react-unit-integration-which-framework-to-use-for-react-unit-testing-and-in,"['javascript', 'reactjs', 'unit-testing', 'integration-testing']",204,True,0,3
StencilJS E2E testing: How do you dispatch a custom event?,"<p>How do you dispatch a CustomEvent to an element in StencilJS E2E testing:</p>

<pre><code>const page = await newE2EPage({html: `&lt;my-component&gt;&lt;/my-component&gt;`});
let component = await page.find('my-component');

?? component.dispatch(new Event('my-event'));
</code></pre>

<p>In the code above I'm trying to dispatch a customEvent to my component so I can test to see it responds correctly.  But I do not see any way of doing this in newE2EPage.  Any suggestions?</p>
",https://stackoverflow.com/questions/57421937/stenciljs-e2e-testing-how-do-you-dispatch-a-custom-event,"['typescript', 'web-component', 'e2e-testing', 'stenciljs']",1356,True,2,1
Get element in puppeteer to be used in jQuery,"<p>I am making tests for my project and am using jest and puppeteer for e2e testing. I need to get raw elements from the page and run jquery operations on it.</p>

<p>I have already tried: </p>

<pre class=""lang-js prettyprint-override""><code>var temp = await page.$eval(modal1, (e) =&gt; $(e).text());
</code></pre>

<p>but I need: </p>

<pre class=""lang-js prettyprint-override""><code>var temp = await page.$eval(modal1, (e) =&gt; $(e));
var tempText = temp.text();
</code></pre>

<p>When I try this I get an undefined object.</p>
",https://stackoverflow.com/questions/56937057/get-element-in-puppeteer-to-be-used-in-jquery,"['javascript', 'jestjs', 'puppeteer']",87,False,0,0
Cleandestination in jasmine html reporter is not working,"<p>I am using the following code to generate <code>HTML</code> report for e2e testing in protractor.</p>

<pre><code>jasmine.getEnv().addReporter(new HtmlReporter({
     baseDirectory: './e2e/e2e_coverage/',
     savePath: './e2e/e2e_coverage/',
     screenshotsFolder: 'images',
     takeScreenShotsOnlyForFailedSpecs: true,
     cleanDestination: true,
     fixedScreenshotName: true,
     htmlReportDir: './e2e/e2e_coverage/htmlReports/',
     jsonsSubfolder: 'jsons',
     docTitle: 'HTMLreport.html'
     }).getJasmine2Reporter());
</code></pre>

<p>Here, clean destination is not cleaning the previous run results. It is appending the previous run results which is generating duplicate results in <code>HTML</code> report.</p>

<p>I am using <code>protractor-beautiful-reporter version 1.2.7</code>.</p>

<p>Please let me know what I am missing.</p>
",https://stackoverflow.com/questions/56123464/cleandestination-in-jasmine-html-reporter-is-not-working,"['protractor', 'e2e-testing', 'jasmine2.0']",784,True,0,2
Click on table cell value in protractor,"<p>I have a table of values that include images, text and numbers.
I want to click on a particular text and haven't been able to do. I am new to e2e testing with protractor so please help.</p>

<p>I need to click on the text ""Created By Test Automation""</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;td class=""custom-t-act mat-cell cdk-column-name mat-column-name ng-tns-c15-3 ng-star-inserted""
    _ngcontent-c15="""" mat-cell="""" role=""gridcell""&gt;
  &lt;h5 _ngcontent-c15="""" class=""mb-0 pointer"" tabindex=""0""
      ng-reflect-router-link=""/projects/created-by-test-auto""&gt;
    &lt;b _ngcontent-c15="""" class=""ng-tns-c15-3""&gt;Created by Test Automation&lt;/b&gt;
  &lt;/h5&gt;
&lt;/td&gt;</code></pre>
</div>
</div>
</p>
",https://stackoverflow.com/questions/54402180/click-on-table-cell-value-in-protractor,"['javascript', 'angularjs', 'automation', 'protractor', 'automated-tests']",321,True,0,1
Detox E2E tests won&#39;t run on react-native project,"<p>I'm trying to implement detox for E2E testing in a react-native project and when I try to run the detox test command it just hangs</p>

<p>When I run a debug synchronization I think this is the issue I'm running into:</p>

<pre><code>DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=f1dbfa2b-7dff-df8d-8a71-66b0b637f61d)
</code></pre>

<p>and then ultimately this spits out in a loop:</p>

<pre><code>etox[63865] INFO:  [actions.js] Sync JavaScript Timers: Javascript Timers Ids: 13729, 13730
detox[63865] INFO:  [actions.js] Sync Dispatch Queue: com.apple.main-thread
detox[63865] INFO:  [actions.js] Sync JavaScript Timers: Javascript Timers Ids: 13741, 13742
detox[63865] INFO:  [actions.js] Sync Dispatch Queue: com.apple.main-thread
detox[63865] INFO:  [actions.js] Sync WXRunLoopIdlingResource: React Native thread is busy.
detox[63865] INFO:  [actions.js] Sync Dispatch Queue: com.apple.main-thread
detox[63865] INFO:  [actions.js] Sync Dispatch Queue: com.facebook.react.ShadowQueue
</code></pre>
",https://stackoverflow.com/questions/56432153/detox-e2e-tests-wont-run-on-react-native-project,"['ios', 'react-native', 'jestjs', 'detox']",415,True,1,1
How to filter through assertion on deep child div content but yield original element?,"<p>I have a DOM tree and would like to use <code>cypress</code> to do e2e testing.</p>

<pre><code>&lt;div class=""this-is-an-array""&gt;
  &lt;div class=""array-item-element""&gt;
    ...
  &lt;/div&gt;
  &lt;div class=""array-item-element""&gt;
    &lt;div class=""very""&gt;
      &lt;div class=""deep""&gt;
        &lt;div class=""child""&gt;
          &lt;div class=""element""&gt;
            Expected Content
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=""another""&gt;
      &lt;div class=""component""&gt;
        &lt;div class=""dom""&gt;
          &lt;div class=""tree""&gt;
            &lt;button&gt;ButtonToClick&lt;/button&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=""array-item-element""&gt;
    ...
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I would like to filter out expected item by asserting on its one child component and click on its another child button through possible code like this:</p>

<pre><code>cy.get('.this-is-an-array') // get the root node of array
  .find('.array-item-element') // looping over all items
  .should(($el) =&gt; {
    // the very deep child element should contain text of 'Expected Content'
  })
  .get('.another .component .dom .tree button')
  .click()
</code></pre>

<p>How can I write the <code>should</code> clause to achieve this?</p>
",https://stackoverflow.com/questions/57324055/how-to-filter-through-assertion-on-deep-child-div-content-but-yield-original-ele,['cypress'],255,False,0,1
Plugging into on_page_change events in testcafe,"<p>I'm using testcafe to e2e testing, as part of this there's a function that's called whenever a test action results in a page change e.g clicking on links.</p>

<p>I'm looking for a way to not have to do this manually.
Is there a page_change_event in testcafe I can hook into and run said function then?</p>

<p>Any help appreciated, thanks :)</p>
",https://stackoverflow.com/questions/56040559/plugging-into-on-page-change-events-in-testcafe,"['javascript', 'testing', 'automated-tests', 'e2e-testing', 'testcafe']",31,True,1,1
Connect 2 node process to fakeredis,"<p>I'm using <code>fakeredis</code> <a href=""https://www.npmjs.com/package/fakeredis"" rel=""nofollow noreferrer"">https://www.npmjs.com/package/fakeredis</a> for e2e testing. So I have to 2 node process. one is the server and the second is for database seeding, I want both to connect to the same redis client. is that possible? It's written in the docs that I should specify host and port but it didn't work</p>
",https://stackoverflow.com/questions/55616988/connect-2-node-process-to-fakeredis,"['javascript', 'node.js', 'redis', 'node-redis']",101,False,0,1
Giving error on using async/await in jasmine-protractor functions,"<p>I am doing an e2e testing on my angular site using protractor-jasmine. On using async functions and await for rest of the code returning promise is giving error in Jasmine-protractor. </p>

<p>I even included: <code>SELENIUM_PROMISE_MANAGER: false,</code></p>

<pre><code>it('Sub-folder: Manage permission, Edit Folder name, Create Template, View Template', async ()=&gt; {
await obj.getURL();
obj.TealoginUname.sendKeys(data.uname);
obj.TealoginPass.sendKeys(data.pass);
await obj.TealoginButton.click();
await browser.sleep(2000);
})
</code></pre>

<p>Console Error:</p>

<pre><code>Error: Error while waiting for Protractor to sync with the page: ""both angularJS testability and angular testability are undefined.  This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping.  See http://git.io/v4gXM for details""
</code></pre>

<p>In eclipse it's showing error on those lines where <code>async</code>/<code>await</code> are written.
<a href=""https://i.stack.imgur.com/Si6o3.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/Si6o3.png"" alt=""enter image description here""></a></p>

<p>I am using Page object model for dynamic elements. 
<code>var obj=  require(""./somefile.js"");</code></p>

<p>somefile.js:-</p>

<pre><code>function  globalVariables()
{
this.TealoginUname= element(by.model(""vm.login.userid""));
this.TealoginPass= element(by.model(""vm.login.password""));
this.TealoginButton= element(by.xpath(""//*[@id='login-form']/form[1]/button""));

}
</code></pre>
",https://stackoverflow.com/questions/55851955/giving-error-on-using-async-await-in-jasmine-protractor-functions,"['angular', 'eclipse', 'async-await', 'jasmine', 'protractor']",266,False,-1,1
How to test external browser pages on electron application using testcafe,"<p>I'm currently doing E2E testing using testcafe on an electron-vue application. In my authentification phase, I connect to another external application :enter username and password to authenticate. The problem is that I cannot apply test case on the external browser nor recuperate inputs from the external browser. Any suggestions( The external page is triggered via a Vue component button using open method)</p>
",https://stackoverflow.com/questions/58598591/how-to-test-external-browser-pages-on-electron-application-using-testcafe,"['vue.js', 'testing', 'electron', 'e2e-testing', 'testcafe']",177,True,1,1
What is the difference between using `react-testing-library` and `cypress`?,"<p>So, <code>react-testing-library</code> is used for unit/integration testing, and <code>cypress</code> is used for e2e testing.  However, both appear to do the same thing:</p>

<p><code>react-testing-library</code></p>

<ul>
<li>Facilitates mocking</li>
<li>Tests as a user would</li>
<li>Starts with the top-level component (not a hard and fast requirement, but if you don't you end up with a bunch of duplicate test cases in your sub-component testing)</li>
<li>Instant feedback, fast</li>
</ul>

<p><code>cypress</code></p>

<ul>
<li>Facilitates mocking</li>
<li>Tests as a user would</li>
<li>Starts with the top-level component (the page)</li>
<li>Delayed feedback, slow, but provides extra tooling (video proof, stepping through tests, etc.)</li>
</ul>

<p>Aside from the feedback cycle, they appear to be almost identical.  Can somebody clarify what the differences are?  Why would you want to use both?</p>
",https://stackoverflow.com/questions/59162638/what-is-the-difference-between-using-react-testing-library-and-cypress,"['cypress', 'react-testing-library']",12741,True,42,2
Can e2e test cases in Katalon be written in Javascript language,"<p>As far as I understand, Katalon (<a href=""https://www.katalon.com/"" rel=""nofollow noreferrer"">https://www.katalon.com/</a> - a tool for e2e testing) can record your actions and make test case scripts out of them (which use Selenium). </p>

<p>You can also write your own test case scripts directly in a programming language.</p>

<p>I'm wondering if the language in which test case scripts are written is only Java, or any other language (Javascript in particular) can be used?</p>
",https://stackoverflow.com/questions/57161325/can-e2e-test-cases-in-katalon-be-written-in-javascript-language,"['testing', 'automated-tests', 'e2e-testing', 'katalon-studio']",291,True,1,1
How to pick a date on DatePicker object with detox in a react-native android app?,"<p>I'm using detox 12.0.0 for e2e testing on a React-Native 0.59.1 app and I cannot figure out how to pick a date on a DatePicker Dialog:</p>

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

<p>Here is the code:</p>

<pre><code>await this.datePicker.tap() // this opens the date picker dialog, current year is 2001
await element(by.text('2000')).tap() // crash happens here
await element(by.text('1999')).tap() 
</code></pre>

<p>Test crashes, here is the output:</p>

<pre><code>    Failed: [Error: Error: No views in hierarchy found matching: (with text: is ""2000"" and view has effective visibility=VISIBLE)

    View Hierarchy:
    +&gt;DecorView{id=-1, visibility=VISIBLE, width=735, height=789, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=WM.LayoutParams{(0,0)(wrapxwrap) gr=#11 sim=#20 ty=2 fl=#1800002 fmt=-3 wanim=0x7f0f0002 needsMenuKey=2 colorMode=0}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
    |
    +-&gt;LinearLayout{id=-1, visibility=VISIBLE, width=651, height=705, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@fbb1f44, tag=null, root-is-layout-requested=false, has-input-connection=false, x=42.0, y=42.0, child-count=2}
    |
    +--&gt;ViewStub{id=16908679, res-name=action_mode_bar_stub, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@8cb382d, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0}
    |
    +--&gt;FrameLayout{id=16908290, res-name=content, visibility=VISIBLE, width=651, height=705, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@57b32f3, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
    |
    +---&gt;AlertDialogLayout{id=16909135, res-name=parentPanel, visibility=VISIBLE, width=651, height=705, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@e2d12dc, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}
    |
    +----&gt;LinearLayout{id=16909385, res-name=topPanel, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@c280d6b, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}
    |
    +-----&gt;LinearLayout{id=16909375, res-name=title_template, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@66f3886, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}
    |
    +------&gt;AppCompatImageView{id=16908294, res-name=icon, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@e381547, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0}
    |
    +------&gt;DialogTitle{id=16908697, res-name=alertTitle, visibility=VISIBLE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@46e174, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, text=, input-type=0, ime-target=false, has-links=false}
    |
    +-----&gt;Space{id=16909370, res-name=titleDividerNoCustom, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@a97869d, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0}
    |
    +----&gt;FrameLayout{id=16908801, res-name=contentPanel, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@c56bee3, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
    |
    +-----&gt;ScrollView{id=16909223, res-name=scrollView, visibility=VISIBLE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@3eaef99, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
    |
    +------&gt;LinearLayout{id=-1, visibility=VISIBLE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@171ec55, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}
    |
    +-------&gt;Space{id=16909353, res-name=textSpacerNoTitle, visibility=VISIBLE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@241b66a, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0}
    |
    +-------&gt;AppCompatTextView{id=16908299, res-name=message, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@b8b275b, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, text=, input-type=0, ime-target=false, has-links=false}
    |
    +-------&gt;Space{id=16909352, res-name=textSpacerNoButtons, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@b9fabf8, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0}
    |
    +----&gt;FrameLayout{id=16908808, res-name=customPanel, visibility=VISIBLE, width=651, height=557, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@8bccf36, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
    |
    +-----&gt;FrameLayout{id=16908331, res-name=custom, visibility=VISIBLE, width=651, height=557, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@a1f8fa4, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
    |
    +------&gt;DatePicker{id=16908812, res-name=datePicker, visibility=VISIBLE, width=651, height=557, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@4fea8c2, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
    |
    +-------&gt;LinearLayout{id=-1, visibility=VISIBLE, width=651, height=557, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@9b9f109, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}
    |
    +--------&gt;LinearLayout{id=16909151, res-name=pickers, visibility=VISIBLE, width=651, height=557, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@e8794c5, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}
    |
    +---------&gt;NumberPicker{id=16909058, res-name=month, visibility=VISIBLE, width=168, height=473, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=true, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@7a09d4b, tag=null, root-is-layout-requested=false, has-input-connection=false, x=21.0, y=42.0, child-count=1}
    |
    +----------&gt;CustomEditText{id=16909105, res-name=numberpicker_input, visibility=VISIBLE, width=168, height=51, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@cb571e6, tag=null, root-is-layout-requested=false, has-input-connection=true, editor-info=[inputType=0x80001 imeOptions=0x5 privateImeOptions=null actionLabel=null actionId=0 initialSelStart=3 initialSelEnd=3 initialCapsMode=0x0 hintText=null label=null packageName=null fieldId=0 fieldName=null extras=null hintLocales=null contentMimeTypes=null ], x=0.0, y=211.0, text=Mar, input-type=524289, ime-target=false, has-links=false}
    |
    +---------&gt;NumberPicker{id=16908819, res-name=day, visibility=VISIBLE, width=168, height=473, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@5829d4, tag=null, root-is-layout-requested=false, has-input-connection=false, x=231.0, y=42.0, child-count=1}
    |
    +----------&gt;CustomEditText{id=16909105, res-name=numberpicker_input, visibility=VISIBLE, width=168, height=51, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@40977d, tag=null, root-is-layout-requested=false, has-input-connection=true, editor-info=[inputType=0x2 imeOptions=0x5 privateImeOptions=null actionLabel=null actionId=0 initialSelStart=0 initialSelEnd=0 initialCapsMode=0x0 hintText=null label=null packageName=null fieldId=0 fieldName=null extras=null hintLocales=null contentMimeTypes=null ], x=0.0, y=211.0, text=29, input-type=2, ime-target=false, has-links=false}
    |
    +---------&gt;NumberPicker{id=16909471, res-name=year, visibility=VISIBLE, width=168, height=473, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@956ac3, tag=null, root-is-layout-requested=false, has-input-connection=false, x=441.0, y=42.0, child-count=1}
    |
    +----------&gt;CustomEditText{id=16909105, res-name=numberpicker_input, visibility=VISIBLE, width=168, height=51, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@bf80f40, tag=null, root-is-layout-requested=false, has-input-connection=true, editor-info=[inputType=0x2 imeOptions=0x6 privateImeOptions=null actionLabel=null actionId=0 initialSelStart=0 initialSelEnd=0 initialCapsMode=0x0 hintText=null label=null packageName=null fieldId=0 fieldName=null extras=null hintLocales=null contentMimeTypes=null ], x=0.0, y=211.0, text=2001, input-type=2, ime-target=false, has-links=false}
    |
    +--------&gt;CalendarView{id=16908770, res-name=calendar_view, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@c46d7be, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
    |
    +---------&gt;DayPickerView{id=16908770, res-name=calendar_view, visibility=VISIBLE, width=0, height=0, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=true, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@e94b1ca, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}
    |
    +----------&gt;DayPickerViewPager{id=16908821, res-name=day_picker_view_pager, visibility=VISIBLE, width=0, height=0, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=true, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@fb76f3b, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=0}
    |
    +----------&gt;AppCompatImageButton{id=16909171, res-name=prev, desc=Previous month, visibility=VISIBLE, width=0, height=0, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=true, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@7a08658, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0}
    |
    +----------&gt;AppCompatImageButton{id=16909075, res-name=next, desc=Next month, visibility=INVISIBLE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=true, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@85833b1, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0}
    |
    +----&gt;ScrollView{id=16908757, res-name=buttonPanel, visibility=VISIBLE, width=651, height=148, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@723c417, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=557.0, child-count=1}
    |
    +-----&gt;ButtonBarLayout{id=-1, visibility=VISIBLE, width=651, height=148, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@689b022, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=4}
    |
    +------&gt;AppCompatButton{id=16908315, res-name=button3, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=true, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@8968ab3, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, text=, input-type=0, ime-target=false, has-links=false}
    |
    +------&gt;Space{id=16909293, res-name=spacer, visibility=INVISIBLE, width=217, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@fcdc870, tag=null, root-is-layout-requested=false, has-input-connection=false, x=32.0, y=137.0}
    |
    +------&gt;AppCompatButton{id=16908314, res-name=button2, visibility=VISIBLE, width=202, height=126, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@450a7e9, tag=null, root-is-layout-requested=false, has-input-connection=false, x=249.0, y=11.0, text=Cancel, input-type=0, ime-target=false, has-links=false}
    |
    +------&gt;AppCompatButton{id=16908313, res-name=button1, visibility=VISIBLE, width=168, height=126, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@b6ac6e, tag=null, root-is-layout-requested=false, has-input-connection=false, x=451.0, y=11.0, text=OK, input-type=0, ime-target=false, has-links=false}
    |]
</code></pre>

<p>It should pick 2000 but I'm suspecting this is a native dialog to which detox cannot access it, could it be? Is there an alternative (with detox)?</p>
",https://stackoverflow.com/questions/55413726/how-to-pick-a-date-on-datepicker-object-with-detox-in-a-react-native-android-app,"['android', 'react-native', 'datepicker', 'detox']",1914,True,2,2
Protractor E2E testing: LoginPage,"<p>So, I am trying to test my login page using protractor e2e testing for my ionic app. This is my first time using protractor and I am having trouble understanding the error that I am getting.</p>

<blockquote>
  <p>Error:- Failed: no such element: Unable to locate element: {""method"":""css selector"",""selector"":""*[id=""user1""]""}</p>
</blockquote>

<p>I'm stuck, i just need guidance. It's my first time testing.</p>

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

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

browser.driver.get('http://url.path/login');


it('login page works', function() {
  // Checking the current url
  var currentUrl = browser.driver.getCurrentUrl();
  expect(currentUrl).toMatch('/login');
});

it('should sign in', function() {


// Find page elements
 var userNameField = browser.driver.findElement(by.id('username'));

 var userPassField = browser.driver.findElement(by.id('password'));
//  var userLoginBtn  = browser.driver.findElement(By.id('loginbtn'));

// Fill input fields
userNameField.sendKeys('nick@email.com');
userPassField.sendKeys('123456');

// Ensure fields contain what we've entered
// expect(userNameField.getAttribute('value')).toEqual('nick@email.com');
// expect(userPassField.getAttribute('value')).toEqual('123456');

// Click to sign in - waiting for Angular as it is manually bootstrapped.
// userLoginBtn.click();

return browser.driver.wait(function() {
      return browser.driver.getCurrentUrl().then(function(url) {
          return /success/.test(url);
      });
}, 10000);
});
});
</code></pre>

<p>Login.html:</p>

<pre><code>&lt;!--
  Generated template for the LoginPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
--&gt;
&lt;link href=""https://fonts.googleapis.com/css?family=Sacramento"" type=""text/css"" rel=""stylesheet""&gt;

&lt;ion-header&gt;

    &lt;ion-navbar transparent&gt;
      &lt;!--ion-title&gt;Login&lt;/ion-title--&gt;
    &lt;/ion-navbar&gt;

  &lt;/ion-header&gt;


  &lt;ion-content padding&gt;

    &lt;div class=""align""&gt;
        &lt;h1&gt;Atelier&lt;/h1&gt;
    &lt;/div&gt;

      &lt;ion-card&gt;
          &lt;ion-card-header&gt;
           Login
          &lt;/ion-card-header&gt;
          &lt;ion-card-content&gt;
             &lt;ion-list &gt;
               &lt;ion-item&gt;  
                   &lt;ion-input id=""username"" type=""email""      placeholder=""Email"" [(ngModel)]=""user.email""&gt;&lt;/ion-input&gt;
               &lt;/ion-item&gt;
               &lt;ion-item&gt;  
                   &lt;ion-input id =""password"" type=""password"" placeholder=""Password"" [(ngModel)]=""user.password""&gt;&lt;/ion-input&gt;
               &lt;/ion-item&gt;
              &lt;button  ion-button full clear color=""light"" (click)=""login(user)""&gt;Login&lt;/button&gt;
              &lt;button ion-button block round outline color=""light"" (click)=""register()""&gt;Register&lt;/button&gt;
             &lt;/ion-list&gt;    
          &lt;/ion-card-content&gt;
        &lt;/ion-card&gt;

  &lt;/ion-content&gt;

    &lt;style&gt;
      h1{
        font-size: 3em;
        text-align: center;
        font-family: Sacramento;
        font-style: cursive;
        color: white;
        text-shadow: 4px 4px 4px rgba(0,0,0,0.1); 
      }
  &lt;/style&gt;
</code></pre>

<p>app.po.ts:</p>

<pre><code>import { browser, by, element } from 'protractor';

export class LoginPage {
 navigateTo(){
  return browser.get('/login');
 }
 get usernameLabel() {
  return element(by.css('.login-field:nth-child(1) label'));
  }

 getEmailTextbox() {
  return element(by.id('username'));
 }
 get passwordLabel() {
  return element(by.css('.login-field:nth-child(2) label'));
  }
getPasswordTextbox() {
 return element(by.id('password'));
  }
  }

   export class Page {

   navigateTo(){
    return browser.get('/login');
      }

    getTitle() {
   return browser.getTitle();
    }

   getPageOneTitleText() {
   return element(by.tagName('page-page1')).element(by.tagName('ion-  title')).element(by.css('.toolbar-title')).getText();
     }

  goToLoginPage(): any{
   let LoginPage = require(""../src/pages/login/login"").default;
   return new LoginPage();
  }

 getUser(){
   return element(by.id('username'))
 }

  getPass(){
   return element(by.id('password'))
   }

 }
</code></pre>
",https://stackoverflow.com/questions/55878098/protractor-e2e-testing-loginpage,"['angular', 'typescript', 'ionic-framework', 'protractor', 'e2e-testing']",589,False,1,1
e2e testing in a nest js with prisma graphql api,"<p>I created a nest js with prisma graphql api. How can i create and run some e2e testing for my api. It would be ideal if i could run my tests against my staging db. Beneath is a starting point i have. But i am not sure where i need to define my prisma service and how i can use it inside my tests.</p>

<pre><code> beforeEach(async () =&gt; {
        const moduleFixture: TestingModule = await Test.createTestingModule({
          imports: [
            UserModule,
            GraphQLModule.forRoot({
              autoSchemaFile: 'src/schema.graphql',
            }),
          ],
        }).compile();

        app = moduleFixture.createNestApplication();
        await app.init();
      });
</code></pre>

<p>Kind regards,</p>

<p>Gerry</p>
",https://stackoverflow.com/questions/59221901/e2e-testing-in-a-nest-js-with-prisma-graphql-api,"['node.js', 'graphql', 'nestjs', 'prisma']",1720,False,0,1
TestCafe - Error in fixture.beforeEach hook,"<p>I'm doing some e2e testing with Testcafe for an application. For one of my fixtures I'm using a beforeEach. My Selector is waiting for an element to be present before it clicks on it on the page. Sometimes this test passes, and sometimes this test fails. It is very inconsistent.</p>

<p>Code:</p>

<pre class=""lang-js prettyprint-override""><code>fixture`Ingredient Details [En]`   
    .page`${url}en/something`   
    .beforeEach(async t =&gt; {              
        await t   
          .click(button1)   
          .wait(1000)
    })
</code></pre>

<p>Error I'm getting:</p>

<pre><code>1) - Error in fixture.beforeEach hook -
      The specified selector does not match any element in the DOM tree.   

&gt; | Selector('#accept-button')
</code></pre>

<p>It seems that there is some sort of timing issue, whereby it isn't waiting correctly sometimes?      </p>

<p>Thanks.</p>
",https://stackoverflow.com/questions/56133728/testcafe-error-in-fixture-beforeeach-hook,"['testing', 'automated-tests', 'e2e-testing', 'testcafe', 'end-to-end']",2264,True,3,1
How to get autocomplete / hinting for cypress.json inside WebStorm,"<p>Cypress is very popular e2e testing framework but apparently WebStorm does not give any hinting/suggestions when editing its configuration file (cypress.json). </p>

<p><strong>Question is how to get hinting for cypress.json in WebStorm?</strong></p>

<p>P.S. I know you can add a custom JSON schema in WebStorm and if such exists for cypress.json I could add it and get maybe the hinting. But I could not find such schema for cypress.json.</p>
",https://stackoverflow.com/questions/58995254/how-to-get-autocomplete-hinting-for-cypress-json-inside-webstorm,"['webstorm', 'cypress']",1356,True,1,3
Test data in GraphQL API response using protractor,"<p>I have an <strong>Angular 7</strong> application, which consumes <strong>GraphQL</strong> APIs. I'm using Protractor for E2E testing.</p>

<p>I want to check the response result coming from the API when called after login. How can I check GraphQL response data through the e2e protractor?</p>

<p>GQL Endpoint I wish to hit:</p>

<pre><code>export const CurrentPersonQuery = gql`
    query CurrentPersonQuery($cdn_links: Boolean) {
        currentPerson {
            ...
            email
            full_name
            id
            status
            ...
        }
    }
`;
</code></pre>

<p><strong>P.S. - There are resources for testing REST APIs, but I couldn't find one for Graph APIs.</strong></p>
",https://stackoverflow.com/questions/54530945/test-data-in-graphql-api-response-using-protractor,"['angular', 'protractor', 'graphql', 'e2e-testing']",221,False,0,0
How do interact correctly with a range input (slider) in Cypress?,"<p>I'm writing my bachelor thesis about e2e testing in javascript althought I'm not familiar with testing or javascript.</p>

<p>So I have this the range input ""slider"" from the src </p>

<pre><code>&lt;input id=""sum_slider"" class=""input-range js-inv-calc-input-sum-range js-input-range"" type=""range"" name=""investmentsum"" min=""20000"" max=""150000"" value=""20000"" step=""1000"" title=""Investitionsbetrag"" style=""background: -webkit-linear-gradient(left, rgb(255, 196, 0) 0%, rgb(255, 196, 0) 0%, rgb(119, 119, 119) 0%) no-repeat;""&gt;
</code></pre>

<p>Cypress Documentation suggests this</p>

<pre><code>cy.get('input[type=range]').as('range')
  .invoke('val', 25)
  .trigger('change')

cy.get('@range').siblings('p').should('have.text', '25')
</code></pre>

<p>I tried: </p>

<pre><code> cy.get('#sum_slider[type=range]').as('range')
.invoke('val', 0%)
.trigger('change')
</code></pre>

<p>I choose the percent values because the two last percent values are the only one, which changes by using the slider manually.
Has someone same problems with that slider shit out there?
thank you for your help!</p>
",https://stackoverflow.com/questions/55023428/how-do-interact-correctly-with-a-range-input-slider-in-cypress,"['javascript', 'testing', 'slider', 'cypress']",8437,True,5,1
Unable to create a debug configuration for Protractor in WebStorm,"<p>I'm trying to create a debug configuration for an E2E testing app based on Protractor. The actual script reads command line arguments while executing the test and I'm not sure how to implement this in the debug configuration so I'm able to execute tests using the execute button available on my 'it' blocks.</p>

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

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

<p>Would really appreciate it if someone could guide me through creating the configuration file to help me debug.</p>
",https://stackoverflow.com/questions/59318009/unable-to-create-a-debug-configuration-for-protractor-in-webstorm,"['javascript', 'protractor', 'automated-tests', 'webstorm']",53,False,0,1
TestCafe does not route properly with react-router-dom,"<p>I'm attempting to use TestCafe for E2E testing in a react app. The react app uses react-router-dom, so it has a routing section like:</p>

<pre><code>&lt;Router&gt;
    &lt;Switch&gt;
        &lt;Route path='/login' component={Login} /&gt;
        &lt;Route path='/about' component={About} /&gt;
        ...
        &lt;Route component={NotFound} /&gt;
    &lt;/Switch&gt;
&lt;/Router&gt;
</code></pre>

<p>Test cafe loads via proxy, so in local environments, it has a path like (approximately) <code>http://172.24.160.0:54004/http://localhost:8080/login</code>. As a result, react-router-dom cannot match the path properly, and it results in the NotFound path.</p>

<p>Does anyone know about any workarounds for this issue? It seems unusable in its current state.</p>
",https://stackoverflow.com/questions/54046887/testcafe-does-not-route-properly-with-react-router-dom,"['reactjs', 'testing', 'automated-tests', 'react-router-dom', 'testcafe']",540,False,2,0
Error when running e2e tests in Visual Studio 2017 with MVC dotNet Core 2.2 and Angular 7,"<p>Trying to set up some e2e testing in VS2017 for an dotnet core 2.2 MVC app that fronts an Angular 7 SPA. </p>

<p>When I run the default tests from Visual Studio, the tests come back as ""Ignored: Task skipped on timeout"". I also get a Jasmine page in a browser with lots of errors.</p>

<p>tsconfig.e2e.json</p>

<pre><code>{
  ""extends"": ""../tsconfig.json"",
  ""compilerOptions"": {

    ""outDir"": ""../out-tsc/app"",
    ""module"": ""commonjs"",
    ""target"": ""es5"",
    ""types"": [
      ""jasmine"",
      ""jasminewd2"",
      ""node""
    ]
  }
}
</code></pre>

<p>protractor.conf.js</p>

<pre><code>// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './src/**/*.e2e-spec.ts'
  ],
  capabilities: {
    'browserName': 'chrome'
  },
  directConnect: true,
  baseUrl: 'http://localhost:53092/',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    print: function() {}
  },
  onPrepare() {
    require('ts-node').register({
      project: require('path').join(__dirname, './tsconfig.e2e.json')
    });
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
  }
};
</code></pre>

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

<pre><code>import { AppPage } from './app.po';
import { browser, logging, by } from 'protractor';

describe('workspace-project App', () =&gt; {
  let page: AppPage;

  beforeEach(() =&gt; {
    page = new AppPage();
  });


  it('should display welcome message', () =&gt; {
    page.navigateTo();
    expect(page.getTitleText()).toEqual('Welcome to a7app!');
  });

  afterEach(async () =&gt; {
    // Assert that there are no errors emitted from the browser
    const logs = await browser.manage().logs().get(logging.Type.BROWSER);
    expect(logs).not.toContain(jasmine.objectContaining({
      level: logging.Level.SEVERE,
    } as logging.Entry));
  });
});
</code></pre>

<p>app.po.ts</p>

<pre><code>import { browser, by, element } from 'protractor';

export class AppPage {
  navigateTo() {
    return browser.get(browser.baseUrl) as Promise&lt;any&gt;;
  }

  getTitleText() {
    return element(by.css('app-root h1')).getText() as Promise&lt;string&gt;;
  }
}
</code></pre>

<p>lines of jasmine output</p>

<pre><code>0 specs, 0 failures, randomized with seed 84783
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/runner.js line 1
Error during loading: Uncaught TypeError: logger_1.Logger is not a constructor in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/index.js line 28
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/driverProvider.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/useExistingWebDriver.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'logger_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/kobiton.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'logger_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/testObject.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'logger_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/sauce.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/mock.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'logger_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/local.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'logger_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/hosted.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/direct.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'logger_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/browserStack.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/driverProviders/attachSession.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'chrome' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/ptor.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/locators.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/expectedConditions.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/element.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/browser.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'selenium_webdriver_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/debugger.js line 1
Error during loading: Uncaught ReferenceError: goog is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/webdriver-js-extender/index.js line 8
Error during loading: Uncaught SyntaxError: Identifier 'blockingproxy_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/blocking-proxy/built/lib/client.js line 1
Error during loading: Uncaught TypeError: Cannot read property 'FindElement' of undefined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/blocking-proxy/built/lib/webdriver_logger.js line 20
Error during loading: Uncaught SyntaxError: Identifier 'webdriver_commands_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/blocking-proxy/built/lib/highlight_delay_barrier.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'http' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/blocking-proxy/built/lib/webdriver_proxy.js line 1
Error during loading: Uncaught TypeError: Class extends value undefined is not a constructor or null in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/blocking-proxy/built/lib/webdriver_commands.js line 112
Error during loading: Uncaught SyntaxError: Identifier 'http' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/blocking-proxy/built/lib/simple_webdriver_client.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'chrome' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/index.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'http' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/safari.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/remote/index.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/phantomjs.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/opera.js line 1
Error during loading: Uncaught TypeError: Cannot read property 'addImplementation' of undefined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/webdriver.js line 2442
Error during loading: Uncaught SyntaxError: Identifier 'by' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/until.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'Capabilities' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/session.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'error' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/promise.js line 1
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/logging.js line 664
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/input.js line 167
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/events.js line 207
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/error.js line 563
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/command.js line 241
Error during loading: Uncaught SyntaxError: Identifier 'Symbols' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/capabilities.js line 1
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/by.js line 282
Error during loading: Uncaught SyntaxError: Identifier 'command' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/actions.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/ie.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'http' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/http/index.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'error' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/http.js line 1
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/atoms/is-displayed.js line 2
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/atoms/get-attribute.js line 2
Error during loading: Uncaught SyntaxError: Identifier 'http' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/firefox/index.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'Executor' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/http/util.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/firefox/profile.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/firefox/extension.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'path' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/io/zip.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/firefox/binary.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'Command' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/io/exec.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/devmode.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/edge.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/chrome.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/net/portprober.js line 1
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/lib/symbols.js line 26
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/io/index.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/selenium-webdriver/node_modules/tmp/lib/tmp.js line 1
Error during loading: Uncaught ReferenceError: process is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/os-tmpdir/index.js line 2
Error during loading: Uncaught SyntaxError: Identifier 'path' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/rimraf/rimraf.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/glob/glob.js line 1
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/once/once.js line 2
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/inflight/inflight.js line 5
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/wrappy/wrappy.js line 6
Error during loading: Uncaught SyntaxError: Identifier 'path' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/glob/common.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/glob/sync.js line 1
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/path-is-absolute/index.js line 18
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/inherits/inherits.js line 6
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/inherits/inherits_browser.js line 3
Error during loading: Uncaught SyntaxError: Identifier 'path' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/minimatch/minimatch.js line 1
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/brace-expansion/index.js line 4
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/balanced-match/index.js line 2
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/concat-map/index.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/fs.realpath/index.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'fs' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/fs.realpath/old.js line 1
Error during loading: Uncaught SyntaxError: Identifier 'logger_1' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/protractor/built/plugins.js line 1
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/url/util.js line 3
Error during loading: Uncaught SyntaxError: Identifier 'EventEmitter' has already been declared in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/events/events.js line 1
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/querystring/encode.js line 40
Error during loading: Uncaught ReferenceError: module is not defined in http://localhost:65086/referenceFile?path=~/ITSAppv303/a7app/node_modules/querystring/decode.js line 31
</code></pre>

<p>I'd expect the tests to at least try to run.</p>
",https://stackoverflow.com/questions/55360307/error-when-running-e2e-tests-in-visual-studio-2017-with-mvc-dotnet-core-2-2-and,"['angular', 'testing', 'model-view-controller', 'jasmine', 'protractor']",248,False,1,0
Is there a way to avoid precompiling assets in a test env for Rails for E2E tests?,"<p>I'm using <a href=""https://www.cypress.io/"" rel=""nofollow noreferrer"">cypress</a> for E2E testing and it requires adding a <code>rake assets:precompile</code> step to my CI build commands. On average it takes about 4 minutes, which is just as long as the tests themselves. When I run tests locally, I don't need to precompile so I would assume that on CI that it wouldn't either but it does. I even have <code>config.assets.compile = true</code> on my <code>test.rb</code> file but it still needs the actually rake precompile task.</p>
",https://stackoverflow.com/questions/56843168/is-there-a-way-to-avoid-precompiling-assets-in-a-test-env-for-rails-for-e2e-test,['ruby-on-rails'],115,False,1,1
Unexpected token error from import statement in cucumber,"<p>I am attempting to create Angular e2e testing using Cucumber and chai.  When I run the tests with 'ng e2e', the E/launcher encounters an error.</p>

<p>I've tried comparing the file to guides/tutorials on the internet but I am new to cucumber and can't seem to find any references to the issue.</p>

<p>protractor.conf.js</p>

<pre><code>// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './src/features/**/*.feature'
  ],
  capabilities: {
    'browserName': 'chrome'
  },
  directConnect: true,
  baseUrl: 'http://localhost:4200/',
  framework: 'custom',
  frameworkPath: require.resolve('protractor-cucumber-framework'),
  cucumberOpts: {
    require: ['./src/steps/**/*.steps.ts'],
  }
};
</code></pre>

<p>app.feature</p>

<pre><code>Feature: Go to the home
  Display the title

  Scenario: Home Page
    Given I am on the home page
    When I do nothing
    Then I should see the title
</code></pre>

<p>app.po.ts</p>

<pre><code>import { browser, by, element } from 'protractor';

export class AppPage {
  navigateTo() {
    return browser.get(browser.baseUrl) as Promise&lt;any&gt;;
  }

  getTitleText() {
    return element(by.css('app-root h1')).getText() as Promise&lt;string&gt;;
  }
}
</code></pre>

<p>app.steps.ts</p>

<pre><code>import { Before, Given, Then, When } from 'cucumber';
import { expect } from 'chai';

import { AppPage } from '../app.po';

let page: AppPage;

Before(() =&gt; {
  page = new AppPage();
});

Given(/^I am on the home page$/, async () =&gt; {
  await page.navigateTo();
});

When(/^I do nothing$/, () =&gt; {});

Then(/^I should see the title$/, async () =&gt; {
  expect(await page.getTitleText()).to.equal('TopicCreationFrontEnd');
});
</code></pre>

<p>I was expecting it to run but instead this is the terminal output that I am getting:</p>

<pre><code>[11:07:51] E/launcher - Error: /Users/n0361431/Developments/Workspaces/Angular/topic-creation-front-end/e2e/src/steps/app.steps.ts:1
(function (exports, require, module, __filename, __dirname) { import { Before, Given, Then, When } from 'cucumber';
                                                                     ^

SyntaxError: Unexpected token {
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at supportCodePaths.forEach.codePath (/Users/n0361431/Developments/Workspaces/Angular/topic-creation-front-end/node_modules/cucumber/lib/cli/index.js:142:42)
    at Array.forEach (&lt;anonymous&gt;)
    at Cli.getSupportCodeLibrary (/Users/n0361431/Developments/Workspaces/Angular/topic-creation-front-end/node_modules/cucumber/lib/cli/index.js:142:22)
    at /Users/n0361431/Developments/Workspaces/Angular/topic-creation-front-end/node_modules/cucumber/lib/cli/index.js:169:41
    at Generator.next (&lt;anonymous&gt;)
    at asyncGeneratorStep (/Users/n0361431/Developments/Workspaces/Angular/topic-creation-front-end/node_modules/cucumber/lib/cli/index.js:44:103)
[11:07:51] E/launcher - Process exited with error code 100
</code></pre>
",https://stackoverflow.com/questions/57181040/unexpected-token-error-from-import-statement-in-cucumber,"['angular', 'typescript', 'cucumber']",1109,True,1,1
How to disable or bypass MSAL authentication when running Angular e2e tests?,"<p>I want to set up some end to end tests for my Angular application, which requires the use of the MSAL library to authenticate with some downstream services.  When I try to run my e2e tests locally, the MSAL library is forcing me to authenticate with a username/password.  </p>

<p>This is a problem because our CI/CD e2e testing should not have any human-intervention; thus I am looking for a way to either bypass the MSAL authentication or set up a service-account to login. Unfortunately there is not a lot of documentation surrounding MSAL for Angular (especially when it comes to e2e testing), but this seems like a common issue that others may have run into.</p>

<p>I've tried to disable the MsalModule from our app.module.ts file but I am still prompted for login when I try to run the application.  I've also seen some articles trying to programmatically log in, but this does not work for us as MSAL is technically not an Angular component we are able to touch.</p>

<p>app.module.ts:</p>

<pre><code>@NgModule({
  ...
  imports: [
    ...
    MsalModule.forRoot({
      clientID: '&lt;client_id&gt;',
      authority: &lt;microsoft_authority_url&gt;,
      validateAuthority: true,
      redirectUri: ""http://localhost:4200/"",
      cacheLocation : ""localStorage"",
      postLogoutRedirectUri: ""http://localhost:4200/"",
      navigateToLoginRequestUrl: true,
      popUp: true,
      consentScopes: [ ""user.read""],
      unprotectedResources: [""https://www.microsoft.com/en-us/""],
      protectedResourceMap: protectedResourceMap,
      logger: loggerCallback,
      correlationId: '1234',
      level: LogLevel.Info,
      piiLoggingEnabled: true
    })
  ],
  entryComponents: [SaveDialogComponent,
                    GenericDialog, MassChangeDialogComponent],
  providers: [TitleCasePipe,
    {provide: HTTP_INTERCEPTORS, useClass: MsalInterceptor, multi: true}],
  bootstrap: [AppComponent]
})
export class AppModule { }
</code></pre>

<p>Expected result: removing the MSAL authentication module should allow our application to run without needing to log in.</p>

<p>Actual result: application is still prompting for log in, or does not render correctly.</p>
",https://stackoverflow.com/questions/56600532/how-to-disable-or-bypass-msal-authentication-when-running-angular-e2e-tests,"['angular', 'angular-cli', 'e2e-testing', 'azure-ad-msal', 'angular-e2e']",12341,True,7,3
How to avoid using await on every single line,"<p>When using Protractor for E2E Testing, it seems as though every single line of code requires await when <code>SELENIUM_PROMISE_MANAGER: false</code>.</p>

<p>Is there a better way to do this example below?</p>

<p>Originally I was using the <code>SELENIUM_PROMISE_MANAGER: false</code> but ran into issues when needing to use conditionals <code>WebElement.isPresent()</code>. The promise manager was not able to resolve the promises of the <code>isPresent()</code> and just continued execution. So now considering using async/await.</p>

<pre><code>describe('Home Page', async () =&gt; {

  beforeAll(async () =&gt; {
    await loginPage.loadPage();  // methods defined in Page Object
    await loginPage.login();     // uses WebElement.sendKeys() and Webelement.submit()
    await homePage.closeModal();
  });

  it('should fill a form', async () =&gt; {
    await $('#field1').clear();
    await $('#field1').sendKeys('hello');
    await $('#field2').clear();
    await $('#field2').sendKeys('world');
    $('form').submit();
  }
}
</code></pre>

<p>If almost every line needs an await, is there something i'm missing here?</p>
",https://stackoverflow.com/questions/56639801/how-to-avoid-using-await-on-every-single-line,"['angular', 'typescript', 'protractor']",1866,True,2,2
Cypress.io testing for drop down list,"<p>I have an angular 2+ application and I am using cypress.io for E2E testing.</p>

<p>I am having trouble creating a test where I have multiple drop down list.</p>

<p>I want to write cypress.io code to select a drop down list, choose my desired option, and move on to the next drop down list. I am unable to invoke drop down list, choose the value, etc.</p>

<p>My test gets stopped as follows:</p>

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

<p>Here is my code so far..</p>

<p><div class=""snippet"" data-lang=""js"" data-hide=""false"" data-console=""true"" data-babel=""false"">
<div class=""snippet-code"">
<pre class=""snippet-code-js lang-js prettyprint-override""><code>/// &lt;reference types=""cypress"" /&gt;

describe('Reminders application test harness', () =&gt; {

  it(`create contact reminder and delete contact and reminder`, () =&gt; {
    cy.visit('http://localhost:4200/home');
    cy.contains('Logout').click();
    cy.contains('Login').click();
    cy.get('#mat-input-0').type('xxxxxxxxxxxx');
    cy.get('#mat-input-1').type('xxxxxxxxxxxxx');
    cy.get('[fxlayout=""column""] &gt; .space-top').click();

    cy.contains('Contacts').click();
    cy.get('#mat-input-5').type('bill');
    cy.get('#mat-input-6').type('gates');
    cy.get('#mat-input-7').type('7145551212');
    cy.get('.mat-raised-button').click();
    cy.get(
      '[style=""left: calc(((33.3333% - 6.66667px) + 10px) * 1); width: calc(((33.3333% - 6.66667px) * 1) + 0px); top: 0px; height: calc(250px);""] &gt; .mat-figure &gt; .mat-card &gt; .mat-card-actions &gt; .update-button &gt; .mat-button-wrapper &gt; .mat-icon'
    ).click();
    cy.get(
      '#mat-select-0 &gt; .mat-select-trigger &gt; .mat-select-arrow-wrapper &gt; .mat-select-arrow'
    ).click();
    // .get('Daily')
    // .click();
  });
});</code></pre>
</div>
</div>
</p>

<p>Please help.</p>
",https://stackoverflow.com/questions/56959506/cypress-io-testing-for-drop-down-list,"['angular', 'cypress']",3259,False,0,1
Why &#39;ng e2e&#39; command does not work truly?,"<p>I try to run 'ng e2e' on this project</p>

<p><a href=""https://medium.com/@dhormale/automate-end-to-end-e2e-testing-for-angular-7-using-protractor-jasmine-4ce171aaeedc"" rel=""nofollow noreferrer"">automate-end-to-end-e2e-testing-for-angular-7-using-protractor-jasmine</a></p>

<p>but this command does not following thing:</p>

<p>1- Run spec in browser (default browser configured is chrome which run with message ‘Chrome is being controlled by automated test software’)</p>

<p>2- Log test execution result on console as below.</p>

<p>termainl show this:</p>

<p><a href=""https://i.stack.imgur.com/gFwGn.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/gFwGn.png"" alt=""terminal message""></a></p>

<p>and intellij IDEA shows on top of app.e2e-spec.ts page this message:</p>

<p><a href=""https://i.stack.imgur.com/79Mgp.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/79Mgp.png"" alt=""TSLint:FetalError:Failed to load""></a></p>

<p>what's wrong?</p>
",https://stackoverflow.com/questions/54549864/why-ng-e2e-command-does-not-work-truly,"['angular', 'jasmine', 'protractor']",1724,False,0,1
"How can I test latency or networking failures with Detox, can I simulate this with code?","<p>I'm trying to do a e2e test when there is no network connection. Is this possible with Detox even if it's simulated, if so, how?</p>

<p>I'm running e2e testing on my react native app for some libraries written in native code, the API calls are on the native library I just need to expect a networking error window to appear from the library.</p>

<p>I was thinking I could emulate latency somehow but I haven't managed to do it so far.</p>
",https://stackoverflow.com/questions/57635083/how-can-i-test-latency-or-networking-failures-with-detox-can-i-simulate-this-wi,"['react-native', 'e2e-testing', 'detox']",199,False,1,0
How to E2E test data within third party package with Protractor - Angular,"<p>I am wondering if it is possible to add a unique identifier to a 3rd party package at the root html element level. For example, I am using the package myDatePicker via NPM. </p>

<p>I can add an ID tag to the actual  html element, but nested inside of that element is an  along with two  that I need to add ID's to for E2E testing purposes. We are using protractor for testing.  </p>

<p>The inspected html looks like this</p>

<pre><code>&lt;my-date-picker ... id=""myDatePickerUniqueID"" ...&gt;
     &lt;div&gt;
        --&gt;&lt;input **'where I want my id field'**&gt;
     &lt;/div&gt;
&lt;/my-date-picker&gt;
</code></pre>

<p>Any help is appreciated. </p>
",https://stackoverflow.com/questions/54750936/how-to-e2e-test-data-within-third-party-package-with-protractor-angular,"['html', 'angular', 'testing', 'protractor', 'e2e-testing']",116,True,0,1
Is it possible to run Cucumber.js programmatically?,"<p>I'm constructing a e2e-testing framework which utilizes cucumber. The framework is meant to be used by our customers who build web-applications with our tooling.</p>

<p>I'd like to ensure that the framework is functioning correctly by testing it. Unfortunately it seems that the Cucumber.js API has no means to run the program without using a CLI.
I'd much prefer to avoid running tests based on the outcome of a CLI. </p>

<p>So, my question, is it possible to run cucumber.js programmatically?</p>

<p>I can't find any documentation on this. Thanks in advance for any answers.</p>
",https://stackoverflow.com/questions/58588588/is-it-possible-to-run-cucumber-js-programmatically,"['javascript', 'cucumber', 'command-line-interface']",621,True,2,2
How to get query params from protractor APIs,"<p>I'm performing <strong>E2E</strong> testing on my <strong>Angular 7</strong> application where I have a test case where I am applying filters from UI and the filter are attached to URL of the as <strong>query parameters</strong>.</p>

<p>The URL generated will look like:</p>

<p><code>http://localhost:4000/search?programme=1</code></p>

<p>But when I'm using <code>browser.getCurrentUrl()</code> it is just returning <code>http://localhost:4000/search</code> <strong>without</strong> the query params.</p>

<p>Now I'm using <code>browser.getLocationAbsUrl()</code> but Protractor itself is throwing error it is <strong>deprecated</strong>.</p>

<pre><code>it('Select GV filter and check params', () =&gt; {
    searchPage.selectOnePrgram();
    expect&lt;any&gt;(browser.getLocationAbsUrl()).toContain('program=1'); 
   // [11:53:11] W/protractor - `browser.getLocationAbsUrl()` is deprecated, please use `browser.getCurrentUrl` instead.

});
</code></pre>

<p>My question is how can I get the query params into my <code>.spec.ts</code> file? </p>

<p><strong>IS IT EVEN COMES IN THE E2E SCOPE OR IT SHOULD BE IN  UNIT TEST?</strong></p>
",https://stackoverflow.com/questions/55586366/how-to-get-query-params-from-protractor-apis,"['angular', 'protractor', 'e2e-testing']",1054,True,2,2
How would you test responsive logic in JavaScript?,"<p>I am writing a custom React hook which has the following logic (simplified a bit):</p>

<pre class=""lang-js prettyprint-override""><code>function useResponsive&lt;T&gt;(options: Array&lt;[string, T]&gt;) {
  for (const [mediaQuery, result] of options)
    if (window.matchMedia(mediaQuery).matches) return result

  return undefined
}
</code></pre>

<p>Now I'm testing this by mocking <code>window.matchMedia</code> before each test case like this:</p>

<pre class=""lang-js prettyprint-override""><code>// simulate small screen window
window.matchMedia = mediaQuery =&gt; ({matches: mediaQuery === '(min-width: 320px)'}) // small screen
// run test then undo mocking

// simulate medium screen window
window.matchMedia = mediaQuery =&gt; ({matches: mediaQuery === '(min-width: 480px)'})
// run test then undo mocking
</code></pre>

<p>I'm using Jest and JSDOM and <code>window.matchMedia</code> is not implemented there, JSDOM doesn't do the actual painting.</p>

<p>I'd like to test this end-to-end <strong>without any mocks</strong>, by just setting window dimensions, in order to be sure my <code>useResponsive</code> hook works as expected.</p>

<p>Should I pick some e2e testing library? Which is a simple one? Or, is there another option?</p>

<p><strong>Update:</strong> <a href=""https://github.com/amankkg/test-symmetrical-octo-sniffle/blob/6c34e6c2fc1a95313eff3bcdde849319ed1fa6a0/test/index.test.tsx#L8"" rel=""nofollow noreferrer"">source code for my tests atm</a></p>
",https://stackoverflow.com/questions/59448015/how-would-you-test-responsive-logic-in-javascript,"['javascript', 'responsive-design', 'jestjs', 'media-queries', 'e2e-testing']",965,True,0,1
How to stop updating UI snapshots with Cypress e2e snapshot testing and Vue,"<p>I'm running <strong>cypress e2e testing</strong> and <strong>ui snapshotting</strong> with <strong>cypress-image-snapshot</strong> on a <strong>vue</strong> app. Whenever <code>matchImageSnapshot()</code> succeeds, it replaces the existing .png image with a newer one. </p>

<p>I run the following:</p>

<pre><code>vue-cli-service test:e2e
</code></pre>

<p>According to <strong>cypress-image-snapshot</strong> (<a href=""https://github.com/palmerhq/cypress-image-snapshot"" rel=""nofollow noreferrer"">https://github.com/palmerhq/cypress-image-snapshot</a>), base images should not update with <code>updateSnapshots=false</code>. So then tried the following:</p>

<pre><code>vue-cli-service test:e2e --env updateSnapshots=false
</code></pre>

<p>A couple questions about this:</p>

<p>a) Even with updateSnapshots set false, images are still updating. Any ideas?</p>

<p>b) Updating an image with a newer identical image seems unnecessary. Is this the intended behavior?</p>

<p>Running with:</p>

<ul>
<li>Mac OS 10.15.1</li>
<li>Cypress 3.6.1</li>
<li>@vue/cli-service ^4.0.3</li>
<li>cypress-image-snapshot ^3.1.1</li>
</ul>
",https://stackoverflow.com/questions/59277412/how-to-stop-updating-ui-snapshots-with-cypress-e2e-snapshot-testing-and-vue,"['vue.js', 'cypress', 'e2e-testing', 'snapshot', 'vue-cli']",451,False,1,0
Get multiple attributes from a single selector in Puppeteer,"<p>I just created a new React app with the following contents in <strong>App.js</strong>:</p>

<pre><code>import React from 'react';
import logo from './logo.svg';
import './App.css';

function App() {
  return (
    &lt;div className=""App""&gt;
      &lt;header className=""App-header""&gt;
        &lt;img src={logo} className=""App-logo"" alt=""logo"" /&gt;
        &lt;p&gt;
          Edit &lt;code&gt;src/App.js&lt;/code&gt; and save to reload.
        &lt;/p&gt;
        &lt;a
          className=""App-link""
          href=""https://reactjs.org""
          target=""_blank""
          rel=""noopener noreferrer""
        &gt;
          Learn React
        &lt;/a&gt;
      &lt;/header&gt;
    &lt;/div&gt;
  );
}

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

<p>If you don’t know React, then just consider the contents inside the <code>return</code> statement which is basic HTML.</p>

<p>I want to perform E2E testing with Puppeteer so my **App.test.js•• looks like:</p>

<pre><code>import puppeteer from ""puppeteer"";

let browser;
let page;

beforeAll(async () =&gt; {
  browser = await puppeteer.launch({
    headless: false
  });
  page = await browser.newPage();
  await page.goto(""http://localhost:3000/"");
});

test(""renders learn react link"", async () =&gt; {
  await page.waitForSelector("".App"");

  const header = await page.$eval("".App-header&gt;p"", e =&gt; e.innerHTML);
  expect(header).toBe(`Edit &lt;code&gt;src/App.js&lt;/code&gt; and save to reload.`);

  const link = await page.$eval("".App-header&gt;a"", e =&gt; e);
  expect(link.innerHTML).toBe(`Learn React`);
  expect(link.href).toBe(""https://reactjs.org"");
  console.log(link);
});

afterAll(() =&gt; {
  browser.close();
});
</code></pre>

<p>Notice, the <code>link</code> constant and it’s next 4 lines. They don’t work. One way it works is if I do the following:</p>

<pre><code>const linkInnerHTML = await page.$eval("".App-header&gt;a"", e =&gt; e.innerHTML);
const linkHref = await page.$eval("".App-header&gt;a"", e =&gt; e.href);
expect(linkInnerHTML).toBe(`Learn React`);
expect(linkHref).toBe(""https://reactjs.org"");
</code></pre>

<p>But, I want to be able to call a selector <code>.App-header&gt;a</code> once &amp; then call <code>innerHTML</code> and <code>href</code> on it.
I know this is pretty simple but can’t seem to properly search on Google 😂</p>

<p>Any clues?</p>
",https://stackoverflow.com/questions/59190266/get-multiple-attributes-from-a-single-selector-in-puppeteer,"['javascript', 'html', 'reactjs', 'puppeteer']",760,True,1,1
Polling a-sync REST service till result is true within CodeceptJS scenario,"<p>Looking for a solution to poll an a-sync REST call till result is FOUND with Codeception / codeceptJS e2e testing suite. Have no clue at all if this is possible at all. Polling will go on for max 1 to 2 minutes and every 10 seconds will be okay.</p>

<pre><code>Scenario.only('Poll for print job status', async (I, loginAs) =&gt; {

    const guid = '4b46b91f-5e03-4bd1-845e-96d179b9f607';

    const endPointObj = { endPoint: 'https://......../print-service/api/print/job/',
                          headers: { 'Ocp-Apim-Subscription-Key': 'theKey' },
                          APIversion: '?api-version=2019-07-01' 
                        }

    const printJobService = async (guid, found) =&gt; {

      let serviceResultData;
      const serviceResult = await I.sendGetRequest(`${endPointObj.endPoint}${guid}${endPointObj.APIversion}`, endPointObj.headers);

      serviceResultData = serviceResult.data;

      return serviceResultData;
    }

    const printJobServiceResultFound = await printJobService(guid);
    const response = printJobServiceResultFound;
    // checkResult is an external UTIL function that checks the result
    assert.equal(checkResult(response), 'FOUND');

    pause();
});
</code></pre>

<p>So I've got this working, but this is only a 1-time run. Have been thinking of different approaches but only thing I came up with is the retry() function but that relies on something failing. My service doesn't fail.</p>

<p>The function <code>printJobService</code> needs to be polled.</p>

<p>Insights would be much appreciated.</p>
",https://stackoverflow.com/questions/57832010/polling-a-sync-rest-service-till-result-is-true-within-codeceptjs-scenario,"['angular', 'rest', 'codeceptjs']",141,True,0,1
How to isolate the drone pipelines when running the same pipeline multiple times concurrently on the same drone runner?,"<p>I have pipeline that allow concurrency of pipeline, but when the same pipeline run in parallel my pipeline execution will fail in the E2E test. The test fail because test account will race for the session authentication and will logout others account.</p>

<p>I am using puppeteer for E2E testing, so it required to have ip in my test script. And this where is thing things are going wrong as my test connecting to the same docker container instead of the newly created container for the particle pipeline.</p>

<pre><code>kind: pipeline
name: Development

concurrency:
  limit: 10

services:
  # start a new postgres database server for the e2e test
  - name: projectdatabase
    image: postgres
    ports:
      - 5432
    environment:
      POSTGRES_USER: padmin

steps:
  .
  .
  .
  # run the application
  - name: deploy-to-staging
    image: ubuntu
    # run this step container in the background : this so it removed automatically when pipeline execution finished
    detach: true
    commands:
      - cd /drone/src/project/server
      # run the golang executable aka run the project
      - ./server
    depends_on:
      # wait until this steps finish
      - build-frontend
      - build-backend-and-migrate-database

  # run puppeteer end-to-end test
  - name: e2e-test
    image: my-puppeteer-image
    # required because this is private image and doesn't exist in docker.hub
    #
    #
    pull: if-not-exists
    commands:
      # go to puppeteer e2e test
      - cd /drone/src/project/e2e_test
      # install npm modules
      - npm install
      # change the end point from the default/dev-env to the onces created in run application step
      - find /drone/src/project -type f -name ""*.js"" -print0 | xargs -0 sed -i 's/localhost:3535/deploy-to-staging:8080/g'
      # run the tests
      - node test.js


# trigger for dev branch only
trigger:
  branch:
    - dev
</code></pre>

<p>I am trying to make sure they run isolated pipelines to avoid this E2E test failing.</p>
",https://stackoverflow.com/questions/58798969/how-to-isolate-the-drone-pipelines-when-running-the-same-pipeline-multiple-times,"['postgresql', 'docker', 'drone.io']",1211,False,2,0
increase-memory-limit npm package not working with run-node npm package,"<p>I have added ""increase-memory-limit"" package some time back to increase the node memory and fix heap out of memory issue.</p>

<p>I recently introduced cypress to the code base for E2E testing as a pre-commit process and could see that ""run-node"" package has been installed as his dependency.</p>

<p>After this i am getting following error or run git commit</p>

<p>desktone/node_modules/run-node/run-node: line 26: syntax error near unexpected token <code>('
desktone/node_modules/run-node/run-node: line 26:</code>has_node --max-old-space-size=2048() {'</p>

<p>Not sure how to fix the same.</p>

<p>I have following in my package.json for increasing node memory limit</p>

<pre><code>  ""scripts"": {
    ""fix-memory-limit"": ""cross-env LIMIT=2048 increase-memory-limit""
   }
</code></pre>
",https://stackoverflow.com/questions/56336075/increase-memory-limit-npm-package-not-working-with-run-node-npm-package,"['node.js', 'cypress', 'npm-scripts', 'husky']",974,False,1,0
How can I record my Cypress Test on windows?,"<p>I'm almost done with my bachelor thesis about e2e testing.
I can test almost anything but i cant record.</p>

<p>I did what everything what is documented on cypress.docs</p>

<p>On the picture below you ca see i set a project, which is private i got the key command to run cypress record
but when i open powershell und put the command in, i get this shitty error message (the pic below) which i have no clue about and i cant find anything on the internet, cause it seems like everybody useres mac or linux for running cypress</p>

<p>Please help. how can i solve this?</p>

<p><a href=""https://i.stack.imgur.com/qkVO9.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/qkVO9.png"" alt=""Screenshot""></a></p>
",https://stackoverflow.com/questions/55124492/how-can-i-record-my-cypress-test-on-windows,"['windows', 'powershell', 'cypress', 'recording', 'test-runner']",699,True,2,1
Possible to use cypress for e2e with embedded jxbrowser?,"<p>I've recently found and fallen in love with Cypress for e2e testing, much more so than Selenium, but there's a catch: our web app will actually be within jxbrowser, inside a java app.  Whatever e2e framework we choose has to be able to run all the tests within jxbrowser inside of this embedded application (hence why we originally looked at selenium, because of the remote driver)</p>

<p>Is it possible to get this working? We absolutely need the embedded jxbrowser tests (Cots integration, can't get around it), and I'd hate to have to fall back to selenium.</p>
",https://stackoverflow.com/questions/55931271/possible-to-use-cypress-for-e2e-with-embedded-jxbrowser,"['selenium', 'testing', 'cypress', 'jxbrowser']",167,False,0,0
E2E Test Electron With Spectron - Docker Windows,"<p>I'm working in E2E testing in an application running inside Electron, to make it able to run in a pipeline in Jenkins I put it in a docker container that is running a windows service (build version 1903) image. The problem is that the chrome driver is crashing inside the container.</p>

<p>I'm using these dependencies (Spectron and electron):</p>

<pre><code>""electron"": ""^6.0.12"",
""spectron"": ""^8.0.0""
</code></pre>

<p>And I'm getting this error:</p>

<pre><code>{ Error: unknown error: Chrome failed to start: exited normally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location C:\Users\rvlima\node_modules\spectron\lib\launcher.bat is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=78.0.3904.11 (eaaae9de6b8999773fa33f92ce1e1bbe294437cf-refs/branch-heads/3904@{#86}),pla
tform=Windows NT 10.0.18362 x86_64)
    at new RuntimeError (C:\Users\rvlima\node_modules\webdriverio\build\lib\utils\ErrorHandler.js:143:12)
    at Request._callback (C:\Users\rvlima\node_modules\webdriverio\build\lib\utils\RequestHandler.js:318:39)
    at Request.self.callback (C:\Users\rvlima\node_modules\request\request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.EventEmitter.emit (domain.js:448:20)
    at Request.&lt;anonymous&gt; (C:\Users\rvlima\node_modules\request\request.js:1161:10)
    at Request.emit (events.js:198:13)
    at Request.EventEmitter.emit (domain.js:448:20)
    at IncomingMessage.&lt;anonymous&gt; (C:\Users\rvlima\node_modules\request\request.js:1083:12)
    at Object.onceWrapper (events.js:286:20)
    at IncomingMessage.emit (events.js:203:15)
    at IncomingMessage.EventEmitter.emit (domain.js:448:20)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  details: undefined,
  message:
   'Client initialization failed after 10 attempts: RuntimeError Client initialization failed after 10 attempts: ',
  type: 'RuntimeError',
  seleniumStack:
   { type: 'UnknownError',
     message:
      'An unknown server-side error occurred while processing the command.',
     orgStatusMessage:
      'unknown error: Chrome failed to start: exited normally\n  (unknown error: DevToolsActivePort file doesn\'t exi
st)\n  (The process started from chrome location C:\\Users\\rvlima\\node_modules\\spectron\\lib\\launcher.bat is no l
onger running, so ChromeDriver is assuming that Chrome has crashed.)\n  (Driver info: chromedriver=78.0.3904.11 (eaaa
e9de6b8999773fa33f92ce1e1bbe294437cf-refs/branch-heads/3904@{#86}),platform=Windows NT 10.0.18362 x86_64)' } }
</code></pre>

<p>Another point is that this works inside a windows container with the version 1803, but unfortunately, I can't use that version because the Jenkins machine is using the last version of Windows (1903).</p>
",https://stackoverflow.com/questions/58342368/e2e-test-electron-with-spectron-docker-windows,"['docker', 'electron', 'spectron']",684,True,0,1
Can i check whether access_token is issued or not in e2e Testing? (Protractor),"<p>I am new to e2e testing using protractor. I want to ask that while hitting a URL directly, Can we check whether access_token is issued or not? Is there any built-in functions in protractor that can help us manipulating the access_token. I have tried using <code>executeScript</code> but it didn't work. </p>

<p>What I am doing is to test certain functionalities in a component and then before moving to next component i want to check whether the user has access_token or not. If user has access_token he should be allowed to next component otherwise he should be directed to the login page for login</p>
",https://stackoverflow.com/questions/59486757/can-i-check-whether-access-token-is-issued-or-not-in-e2e-testing-protractor,"['angular', 'authentication', 'protractor', 'access-token', 'e2e-testing']",724,True,0,1
Chrome Version 71.x unknown error: call function result missing &#39;value&#39;,"<p><strong>Please don't mark this question as a duplicate, because the other solution doesn't work for me.</strong> </p>

<p>I'm using Angular <code>v5.x</code> and using Protractor for E2E testing. But on running the command.</p>

<p><code>ng e2e -s false</code> </p>

<p>It is throwing an error as</p>

<pre><code> Failed: unknown error: call function result missing 'value'
  (Session info: chrome=71.0.3578.98)
  (Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 10.0.17134 x86_64)

  Stack:
    WebDriverError: unknown error: call function result missing 'value'
      (Session info: chrome=71.0.3578.98)
      (Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 10.0.17134 x86_64)
        at Object.checkLegacyResponse (F:\Commutatus\yop-v3\node_modules\selenium-webdriver\lib\error.js:639:15)
        at parseHttpResponse (F:\Commutatus\yop-v3\node_modules\selenium-webdriver\http\index.js:538:13)
        at client_.send.then.response (F:\Commutatus\yop-v3\node_modules\selenium-webdriver\http\index.js:472:11)
        at ManagedPromise.invokeCallback_ (F:\Commutatus\yop-v3\node_modules\selenium-webdriver\lib\promise.js:1379:14)
        at TaskQueue.execute_ (F:\Commutatus\yop-v3\node_modules\selenium-webdriver\lib\promise.js:2913:14)
        at TaskQueue.executeNext_ (F:\Commutatus\yop-v3\node_modules\selenium-webdriver\lib\promise.js:2896:21)
        at asyncRun (F:\Commutatus\yop-v3\node_modules\selenium-webdriver\lib\promise.js:2820:25)
        at F:\Commutatus\yop-v3\node_modules\selenium-webdriver\lib\promise.js:639:7
        at process._tickCallback (internal/process/next_tick.js:68:7)
</code></pre>

<p>I've followed <a href=""https://github.com/webdriverio/webdriverio/issues/2631"" rel=""nofollow noreferrer"">this</a> issue on GitHub, but no luck!!!
I've also install <strong>latest</strong> chrome driver from this link <a href=""http://chromedriver.chromium.org/downloads"" rel=""nofollow noreferrer"">http://chromedriver.chromium.org/downloads</a>. After unzipping and executing the <code>.exe</code> file a console window opens, prompting this message</p>

<blockquote>
  <p>Starting ChromeDriver 2.45.615291
  (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387) on port 9515 Only local
  connections are allowed.</p>
</blockquote>

<p>I've re-run the same command again but not working. I've also checked using
<code>chromedriver --version</code> the version of <code>chromedriver</code> it is <code>v2.45</code>.</p>

<p><strong>Chrome version - 71.0</strong>
<strong>Chrome drivers version - 2.45</strong></p>
",https://stackoverflow.com/questions/54230191/chrome-version-71-x-unknown-error-call-function-result-missing-value,"['selenium-webdriver', 'protractor', 'selenium-chromedriver', 'e2e-testing']",557,False,3,2
Is it possible to uninitialize/reinitialize/delete role in testcafe E2E test?,"<p>I am using TestCafe for my E2E testing.</p>

<p>Scenario: I am running a test use test runs. For example, first test run executes tests in firefox browser, and next run in chrome (this is just example, I have cases where I need to run e2e tests in different stages as well). I have used a role. When one test run completes, and it is running another test run, still the role cookie persists, and it acts as the user is logged in.</p>

<p>Expected behavior: Roles should be re-initialized for each run.</p>

<p>Is there some way I can clean the cookie, or un-initialize the roles?</p>
",https://stackoverflow.com/questions/56439705/is-it-possible-to-uninitialize-reinitialize-delete-role-in-testcafe-e2e-test,"['testing', 'automated-tests', 'e2e-testing', 'testcafe', 'jquery-cookie']",923,True,3,1
How can I upload one file at a time using sendKeys() in protractor,"<p>In my project, I have a webpage where I can drag &amp; drop a file, when doing e2e testing by protractor, I have to upload it using sendKeys() with the absolute path of my file, here is test script:</p>

<pre><code>    var path = require('path');
    var remote = require('selenium-webdriver/remote');
    it(""===&gt; it will upload document"", function () {

      browser.setFileDetector(new remote.FileDetector());
      let exePath = path.resolve(__dirname, '../bbb/' + fileName);

      $('button[type=""button""],[type=""file""]').isDisplayed().then(function () {
          $('input[type=""file""]').sendKeys(exePath);
      });
    });
</code></pre>

<p>it's working well when I upload 1st file, but when I tried to upload 2nd file using the same code but just update the filename, The 1st uploaded file is automatically uploaded again alone with the 2nd file, instead of only uploading the 2nd file, so I got double 1st file which is not expected. would like to find a way to upload one file at a time, please help, thanks.</p>
",https://stackoverflow.com/questions/58779765/how-can-i-upload-one-file-at-a-time-using-sendkeys-in-protractor,"['upload', 'protractor', 'sendkeys']",116,False,0,0
Can you invoke a method in Cypress using dynamically instantiated objects?,"<p>I'm trying to write e2e tests with Cypress and would like to dynamically be able to intantiate objects and use them as parameters for the <code>invoke</code> method.</p>

<p>The subject under test is a SPA with a redux store. For debugging (and possibly e2e testing), I have a <code>window.debug</code> object. The debug object exposes a <code>dispatchAction(action: Action)</code> method and properties that return classes, for instance <code>Actions.SetMenu</code>.</p>

<p>So on the browsers console I can call something like this to dispatch an action:<code>debug.dispatchAction(new debug.Actions.SetMenu({ menu }))</code></p>

<p>For Cypress I need something like the following:</p>

<pre><code>let setMenuAction;
cy.window()
  .its('debug')
  .then(debug =&gt; {
    const SetMenu = debug.Actions.SetMenu;
    setMenuAction = new SetMenu({ menu });
    console.log(setMenuAction);
    return debug;
  })
  .invoke('dispatchAction', setMenuAction);
</code></pre>

<p>But the above doesn't work. Is there a way to achieve what I'm trying?</p>

<p>Edit: Got it to work, was an async problem:</p>

<pre><code>cy.window()
  .its('debug.Actions.SetMenu')
  .then(SetMenu =&gt; {
    cy.window()
      .its('debug')
      .invoke('dispatchAction', new SetMenu({ menu }));
  })
</code></pre>
",https://stackoverflow.com/questions/58078855/can-you-invoke-a-method-in-cypress-using-dynamically-instantiated-objects,"['nested', 'invoke', 'cypress']",239,False,0,1
"How to wait for a slightly longer scheduler process to finish, while doing e2e testing","<p>How to wait for a slightly longer scheduler process to finish, while doing e2e testing</p>

<p>Hi,</p>

<p>I am automating an E2E scenario, where we put a request for report generation from web-UI.
The workflow is such that, after we click on Submit button for report generation.</p>

<p>A non-blocking process start to run &amp; in min or so it adds a new  in the results table below.</p>

<p>How to wait for such Event (i.e. for the record to get generated on top of existing records stack)?
I would like to avoid arbitrary <code>wait(400)</code> etc.
Bear in mind there might already be few rows in the table, where new row gets generated on top of existing.</p>

<p>Thanks</p>
",https://stackoverflow.com/questions/58117923/how-to-wait-for-a-slightly-longer-scheduler-process-to-finish-while-doing-e2e-t,['cypress'],98,True,2,1
adding tests to ionic v3 prior to v4 upddate,"<p>I have a (complicated, live, in production) ionic app that is currently on ionic-angular 3.9.2 but has been around since (I think) the v1 days.  There are no tests (yikes).</p>

<p>I see that Ionic 4 ships with some e2e testing support which is great, but does me little good since it's not compatible with the version that I'm on.</p>

<p>I'd like to get some e2e tests in place prior to biting the bullet and migrating up to v4 and all the many changes that will entail.</p>

<p>Are there any resources available that can help me add tests to a v3 app in a way that will be compatible with v4 as I go through the update process?</p>
",https://stackoverflow.com/questions/56514600/adding-tests-to-ionic-v3-prior-to-v4-upddate,"['ionic-framework', 'ionic3', 'ionic4']",13,False,0,0
Filereplacements not working for e2e testing,"<p>I want to pick file <code>src/enironments/environment.docker.ts</code> when I run a dockerized version of my e2e testing.</p>

<p>I have added a new e2e section to angular.json</p>

<pre><code>""myapp-e2e"": {
   ...
},
""myapp-e2e-docker"": {
  ""root"": ""e2e"",
  ""sourceRoot"": ""e2e"",
  ""projectType"": ""application"",
  ""architect"": {
    ""e2e"": {
      ""builder"": ""@angular-devkit/build-angular:protractor"",
      ""options"": {
        ""protractorConfig"": ""./protractor.conf.js"",
        ""devServerTarget"": ""myapp:serve:docker""
      }
    }
  }
</code></pre>

<p>I have added a configuration to my serve section:</p>

<pre><code>    ""serve"": {
      ""builder"": ""@angular-devkit/build-angular:dev-server"",
      ""options"": {
        ""browserTarget"": ""myapp:build""
      },
      ""configurations"": {
        ""production"": {
          ""browserTarget"": ""myapp:build:production""
        },
        ""docker"": {
          ""browserTarget"": ""myapp:build:docker""
        }
      }
    }
</code></pre>

<p>And a configuration to my build section:</p>

<pre><code>        ""docker"": {
          ...
          ""fileReplacements"": [
            {
              ""replace"": ""src/environments/environment.ts"",
              ""with"": ""src/environments/environment.docker.ts""
            }
          ]
        }
</code></pre>

<p>Then I invoke my e2e conf like so</p>

<blockquote>
  <p>ng e2e myapp-e2e-docker</p>
</blockquote>

<p>It seem to do what I expect. If, for example, I misspell the name of the environment.docker.ts file it will complain that it can not find it. But then, reading the content of the environment at run-time, I always find the values from <code>src/environments/environment.ts</code></p>

<p>Is this some kind of bug? It looks like that the features for the <code>ng serve</code> facility are not available for the <code>ng e2e</code>.</p>

<p>My package.json file:</p>

<pre><code>""devDependencies"": {
  ""@angular-devkit/build-angular"": ""0.12.1"",
  ""@angular/language-service"": ""6.1.0"",
  ""@types/jasmine"": ""3.0.0"",
  ""@types/jasminewd2"": ""2.0.6"",
  ""@types/node"": ""6.0.60"",
  ""codelyzer"": ""4.2.1"",
  ""jasmine-core"": ""3.3.0"",
  ""jasmine-spec-reporter"": ""4.2.1"",
  ""karma"": ""3.1.1"",
  ""karma-chrome-launcher"": ""2.2.0"",
  ""karma-cli"": ""1.0.1"",
  ""karma-coverage-istanbul-reporter"": ""2.0.4"",
  ""karma-jasmine"": ""2.0.1"",
  ""karma-jasmine-html-reporter"": ""1.4.0"",
  ""protractor"": ""5.3.0"",
  ""ts-node"": ""7.0.1"",
  ""tslint"": ""5.3.2"",
  ""typescript"": ""2.9.2""
}
</code></pre>
",https://stackoverflow.com/questions/54400450/filereplacements-not-working-for-e2e-testing,"['node.js', 'angular-cli', 'angular-e2e']",2112,True,1,1
Re-running complete class and not just @Test in TestNG,"<p>I have been browsing stackoverflow for some days, trying to find how to re-run a whole test class, and not just an <code>@Test</code> step. Many say that this is not supported with TestNG and <code>IRetryAnalyzer</code>, whereas some have posted workarounds, that don't really work.
Has anyone manage to do it?
And just to clarify the reasons for this, in order to avoid answers that say that is not supported in purpose: TestNG is a tool not only for developers. Meaning that is also used from sw testers for e2e testing. E2e tests can have steps that depend each from the previous one. So yes it's valid to re-run whole test class, rather than simple <code>@Test</code>, which is easily can be done via <code>IRetryAnalyzer</code>.</p>

<p>An example of what I want to achieve would be:</p>

<pre><code>public class DemoTest extends TestBase {

@Test(alwaysRun = true, description = ""Do this"")
public void testStep_1() {
    driver.navigate().to(""http://www.stackoverflow.com"");
    Assert.assertEquals(driver.getCurrentUrl().contains(""stackoverflow)""));

}

@Test(alwaysRun = true, dependsOnMethods = ""testStep_1"", description = ""Do that"")
public void testStep_2() {
    driver.press(""button"");
    Assert.assertEquals(true, driver.elementIsVisible(""button""));

}

@Test(alwaysRun = true, dependsOnMethods = ""testStep_2"", description = ""Do something else"")
public void testStep_3() {
   driver.press(""button2"");
Assert.assertEquals(true, driver.elementIsVisible(""button""));

}

}
</code></pre>

<p>Let's say that <code>testStep_2</code> fails, I want to rerun <code>class DemoTest</code> and not just <code>testStep_2</code></p>
",https://stackoverflow.com/questions/59160655/re-running-complete-class-and-not-just-test-in-testng,"['automated-tests', 'testng']",334,True,9,1
How to write an unit and/or e2e test for function that calls services,"<p>How would I approach writing a unit test for this function? When the form is submitted, it sends a POST request to get a login token. With the token response it then sends another request to get the specific user details.</p>

<p>Here is the function:</p>

<pre><code>// Log the user in and save the token, then get the details
onLoginSubmit() {
    this.loggingIn = true;
    // request the token then the details for the user based off the token
    this.userService
        .LoginUser(this.loginForm.value.username, this.loginForm.value.password)
        .pipe(
            tap(res =&gt; {
                // console.log('Obtained Token:', res);
                localStorage.setItem('login_token', res.token);
                // this.utilityService.SetLocalStorage('login_token', res.token, 1, 'd');
            }),
            concatMap(() =&gt; this.userService.GetTokenDetails()),
        )
        .subscribe(
            res =&gt; {
                // console.log('Obtained User Data:', res);
                localStorage.setItem('user', res.user);
                // this.utilityService.SetLocalStorage('user', res.user, 1, 'd');
                this.NavigateToRoute();
            },
            () =&gt; {
                this.loggingIn = false;
            },
        );
}
</code></pre>

<p>Here are the service functions:</p>

<pre><code>// logs in the user
LoginUser(email, password): Observable&lt;any&gt; {
    return this.utilityservice.post('universal/login', { email, password }, this.utilityservice.GetHeaders());
}

// gets details of the current logged in user
GetTokenDetails() {
    return this.utilityservice.get('universal/userAPI', { whoami: '' });
}
</code></pre>

<p>For unit tests I am assuming I need to create a mock service where these functions will return a valid response like the following:</p>

<pre><code>// logs in the user
LoginUser(email, password): Observable&lt;any&gt; {
    return { res: { token: 'test' } };
}
</code></pre>

<p>Is this the right approach or am I completely wrong? Also when it comes to E2E testing for my login page, I am essentially simulating a user in each test by writing code that simulates clicking form buttons and inputting values then checking to make sure I get valid responses or am I over complicating it?</p>
",https://stackoverflow.com/questions/58939672/how-to-write-an-unit-and-or-e2e-test-for-function-that-calls-services,"['angular', 'unit-testing', 'e2e-testing', 'angular-e2e', 'angular-unit-test']",486,True,1,2
Detox Testing a React Native (Expo) + PouchDB App,"<p>We are currently working on a React Native app using Expo and are trying to get Detox (E2E Testing) working in our environment. We have spent a lot of time pinpointing where the issue is. The most likely contender seems to be that pouchDB is set up to be live syncing with our database:</p>

<pre><code>LocalDB.sync(RemoteDB, {live: true, retry: true})
  .on('change', onChange)
</code></pre>

<p>and because of this, detox is waiting for certain network requests to finish that we really don't want detox to wait for:</p>

<pre><code>Sync App State: Waiting for network requests to finish.:
</code></pre>

<p>Our tests are running fine without syncing. In our detox tests we've tried blocking that url in our beforeAll &amp; beforeEach blocks with the following:</p>

<pre><code>await device.setURLBlacklist(['.*(OUR_IP_THAT_COUCH_IS_SYNCING_WITH).*'])
</code></pre>

<p>But this on top of the fact that detox doesn't officially support Expo, requiring multiple restarts to open the app, makes it hard to debug.</p>

<p>If anyone has any ideas about this, any help is greatly appreciated!</p>
",https://stackoverflow.com/questions/54876159/detox-testing-a-react-native-expo-pouchdb-app,"['react-native', 'automated-tests', 'expo', 'pouchdb', 'detox']",403,False,2,0
How do you test user flows that involve confirmation by email?,"<p>I mean functional or E2E testing. That's all clear with generic flows, but when it comes to transactional emails (signup confirmations, password resets, purchase notifications and others) it's still bringing questions. After some research I came up with a few ideas. One is to leverage Restmail.net API (here examples with Selenium WebDriver and Cypress - <a href=""http://dsheiko.com/weblog/testing-sign-up-flow-with-activation-by-email"" rel=""nofollow noreferrer"">http://dsheiko.com/weblog/testing-sign-up-flow-with-activation-by-email</a>). It's free, but API is public. So it's not really suitable for email messages with potentially sensitive information. Another approach to access Gmail inbox via IMAP bridge or Gmail API (here the explanation and code snippets - <a href=""https://docs.puppetry.app/testing-emails/example-with-imap-bridge"" rel=""nofollow noreferrer"">https://docs.puppetry.app/testing-emails/example-with-imap-bridge</a>). But again, it's rather a workaround.</p>

<p>I know there are guys like Sendgrid, Mailgun, Email Yak, Postmark. I don't want to pay that much. So how do you folks do it? It it a thing to you?</p>
",https://stackoverflow.com/questions/56951573/how-do-you-test-user-flows-that-involve-confirmation-by-email,"['testing', 'selenium-webdriver', 'automated-tests', 'e2e-testing', 'cypress']",2476,True,3,3
How to configure Webstorm to run *.spec.ts using Mocha for brand new Vue project,"<p>I can't figure out how to properly setup my WebStorm environment with a brand new created Vue project using the Vue CLI 3...</p>

<p>Repro step:</p>

<ol>
<li><code>npm install -g @vue/cli</code> (my version is latest 3.3.0)</li>
<li>New project in WebStorm</li>
<li>Select Vue.js</li>
<li>Specify the Vue/cli directory (For me it was /usr/local/lib/node_modules/@vue/cli)</li>
<li>Select <em>Manually select features</em></li>
<li>Select all except PWA (Babel, Typescript, Router, Vuex, CSS Pre-processors, Linter/Formatter Unit/E2E Testing)</li>
<li>Default configs until for testing</li>
<li>Select <em>Mocha + Chai</em> for unit tests</li>
<li>Select <em>Nightwatch</em> for E2E tests</li>
<li>Config files in dedicated files</li>
</ol>

<p>Once the project is created, if I right click on the generated unit test file it tries to run it using Jest...</p>

<p>I tried to manually create a a config using Mocha, but can't figure it out... I tried adding <em>Compile TypeScript</em> as a before launch step, tried adding <code>--require ts-node/register</code> after doing <code>npm i -D ts-node</code> but without success...</p>
",https://stackoverflow.com/questions/54444933/how-to-configure-webstorm-to-run-spec-ts-using-mocha-for-brand-new-vue-project,"['typescript', 'mocha.js', 'webstorm', 'vue-cli', 'vue-cli-3']",515,True,0,1
Puppeteer - Cucumber - Use one browser for the tests,"<p>I'm using Puppeteer and Cucumber for E2E testing on my web app.</p>

<p>On each ""steps.js"" file for each feature, I have this in the <code>before</code> method:</p>

<pre><code>Before(async function() {
  this.browser = await puppeteer.launch({ headless: false });
  setDefaultTimeout(60 * 1000);
  this.page = await this.browser.newPage();
  await this.page.emulate(GalaxyS5);
  await this.page.goto(URL);
});
</code></pre>

<p>The problem is when I run it via <code>cucumber-js</code> like so: <code>.\node_modules\.bin\cucumber-js test\e2e\features</code>, what ends up happening is I have 3 Chromium browsers open up. 2 of those then go to the URL I specify and the last one is just a blank page.</p>

<p>After all browsers are opened, 1 of the 2 of where the URL was redirected too then starts executing the tests.</p>

<p>It seems like every new scenario, a new browser window opens up which is not good because I end up getting a lot of browser windows. Is there a way to specify Puppeteer to only use one browser for the testing or at least on a per feature file basis?</p>

<p>My hierarchy for my project is like this:</p>

<pre><code>e2e/
- features/
    - feature1/
      - feature1.feature
      - steps.js (given, when, then, etc.)
    - feature2/
  - world.js
</code></pre>
",https://stackoverflow.com/questions/55765814/puppeteer-cucumber-use-one-browser-for-the-tests,"['javascript', 'cucumber', 'puppeteer', 'cucumberjs']",565,True,0,1
How to create a Kubernetes cluster from within GitLab CI for e2e testing?,"<p>I want to create a Google Cloud Kubernetes cluster programmatically in a GitLab CI script <code>.gitlab-ci.yml</code> in order to do e2e testing against it. Therefore I</p>

<ul>
<li>created a separate project <code>project-e2e</code> (in order to separate the billing)</li>
<li>enabled Kubernetes Engine API</li>
<li>created a service account <code>gitlab-ci@project-e2e.iam.gserviceaccount.com</code> with a key in JSON format which I'm providing through CI variables and using as shown below</li>
<li>made the service account <code>App Engine Admin</code>, <code>Compute Admin</code>, <code>Kubernetes Engine Admin</code>, <code>Kubernetes Engine Cluster Admin</code>, <code>Editor</code>, <code>Service Account User</code> and <code>Owner</code> following permission-role mappings described at <a href=""https://cloud.google.com/kubernetes-engine/docs/reference/api-permissions"" rel=""nofollow noreferrer"">https://cloud.google.com/kubernetes-engine/docs/reference/api-permissions</a> and <a href=""https://cloud.google.com/compute/docs/access/iam"" rel=""nofollow noreferrer"">https://cloud.google.com/compute/docs/access/iam</a></li>
</ul>

<p>The script however fails due to missing permissions of the created service account which should be covered by the assigned roles by as far as I understand (the output contains the commands the stage in the CI script consists of):</p>

<pre><code>$ echo ""$GOOGLE_KEY"" &gt; key.json
$ gcloud config set project project-e2e
Updated property [core/project].
$ gcloud auth activate-service-account --key-file key.json --project project-e2e
Activated service account credentials for: [gitlab-ci@project-e2e.iam.gserviceaccount.com]
$ gcloud config set compute/zone us-central1-a
Updated property [compute/zone].
$ kubectl config get-contexts
CURRENT   NAME   CLUSTER   AUTHINFO   NAMESPACE
$ gcloud container clusters create project-e2e-$CI_COMMIT_SHORT_SHA --project project-e2e --service-account=gitlab-ci@project-e2e.iam.gserviceaccount.com
WARNING: In June 2019, node auto-upgrade will be enabled by default for newly created clusters and node pools. To disable it, use the `--no-enable-autoupgrade` flag.
WARNING: Starting in 1.12, new clusters will have basic authentication disabled by default. Basic authentication can be enabled (or disabled) manually using the `--[no-]enable-basic-auth` flag.
WARNING: Starting in 1.12, new clusters will not have a client certificate issued. You can manually enable (or disable) the issuance of the client certificate using the `--[no-]issue-client-certificate` flag.
WARNING: Currently VPC-native is not the default mode during cluster creation. In the future, this will become the default mode and can be disabled using `--no-enable-ip-alias` flag. Use `--[no-]enable-ip-alias` flag to suppress this warning.
WARNING: Starting in 1.12, default node pools in new clusters will have their legacy Compute Engine instance metadata endpoints disabled by default. To create a cluster with legacy instance metadata endpoints disabled in the default node pool, run `clusters create` with the flag `--metadata disable-legacy-endpoints=true`.
WARNING: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s). 
This will enable the autorepair feature for nodes. Please see https://cloud.google.com/kubernetes-engine/docs/node-auto-repair for more information on node autorepairs.
ERROR: (gcloud.container.clusters.create) ResponseError: code=403, message=Required ""container.clusters.create"" permission(s) for ""projects/project-e2e"". See https://cloud.google.com/kubernetes-engine/docs/troubleshooting#gke_service_account_deleted for more info.
</code></pre>

<p>I tried</p>

<ul>
<li>omitting <code>--service-account=gitlab-ci@project-e2e.iam.gserviceaccount.com</code> which has no effect</li>
<li>finding answers in <a href=""https://cloud.google.com/kubernetes-engine/docs/troubleshooting#gke_service_account_deleted"" rel=""nofollow noreferrer"">https://cloud.google.com/kubernetes-engine/docs/troubleshooting#gke_service_account_deleted</a> which seems unrelated</li>
<li>adding and omitting <code>--no-enable-legacy-authorization</code> which has no effect</li>
</ul>

<p><a href=""https://i.stack.imgur.com/QoHsI.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/QoHsI.png"" alt=""enter image description here""></a></p>
",https://stackoverflow.com/questions/57435082/how-to-create-a-kubernetes-cluster-from-within-gitlab-ci-for-e2e-testing,"['kubernetes', 'gitlab', 'gcloud', 'google-iam', 'google-cloud-iam']",220,False,4,0
Is automated testing of a Nativescript app possible with Bluestacks?,"<p>I'd like to write a nativescript application and I'd like to test it with an android and ios emulator befor releasing it. I use bluestacks, so I thought maybe it is possible to run somehow automated tests on it. I need to test its integration with android or ios, so the push notifications, getting the GPS coords, going offline, doing HTTP requests, saving to a local storage and probably e2e testing with the GUI. Now I work on the logic, data processing, etc. which is vanilla js and I can test it easily with nodejs, but sooner or later I'll have to test the other parts too somehow. Is there any solution to make it work with bluestacks or other mobile phone emulators? Note that I don't want to use some sort of online service like saucelabs, just emulators and virtual machines what I want to do on my dev computer...</p>
",https://stackoverflow.com/questions/59438704/is-automated-testing-of-a-nativescript-app-possible-with-bluestacks,"['android', 'ios', 'nativescript', 'e2e-testing', 'bluestacks']",380,False,0,0
How to handle Angular 2+ (7) routing changes without refactoring?,"<p>Right now, the recommended routing is to have a routes array that would look something like this:</p>

<pre><code>const appRoutes: Routes = [
    { path: '', redirectTo: '/login', pathMatch: 'full' },
    { path: 'page1', component: Page1Component },  // can't use RouterStringService here I don't think...
    { path: 'page2', component: Page2Component }
]
@NgModule({...})
export class AppRouting Module {}
</code></pre>

<p>This is all good and well. We can use this to navigate:</p>

<ul>
<li>ts files - <code>router.navigate(['/page1'])</code></li>
<li>html files - <code>[routerLink]=""/page1""</code></li>
</ul>

<p>Cool. This works great. However, what happens if we need to change <code>page1</code> to <code>home-feed</code> (or anything that's not <code>page1</code>)? Refactoring string literals is a pita and asking for problems (especially in html). We can use redirects like so:</p>

<pre><code>// changes to above code block
{ path: 'page1', redirectTo: 'new-page1' },
{ path: 'new-page1', component NewPage1Component },
</code></pre>

<p>But this just adds the mental overhead of remembering redirects because other code references will still potentially be <code>router.navigate(['/page1'])</code>.</p>

<p>We can also use a service that's imported almost everywhere. This (unless I'm mistaken) wouldn't be usable within <code>appRoutes</code> because that's declared outside a module? (this is noted in the first code block)</p>

<pre><code>export class RouterStringService {
    static page1: string = '/page1'
    static page2: string = '/page2

    // put string builders here too for things like /pageX/:id

    constructor() {}
}
</code></pre>

<p>How do you guys handle this? I know the refactoring isn't ideal, but there are times when it has to happen. I'm mostly worried about missing routing because angular 7 pushes using string literals. Do you use e2e testing to catch this or can you fix it programmatically?</p>
",https://stackoverflow.com/questions/55265165/how-to-handle-angular-2-7-routing-changes-without-refactoring,"['angular', 'angular7']",68,True,2,1
Cloud Functions vs Firebase SDK for web project,"<p>I'm about to start writing my Firebase Firestore calls for a React web project, and I would like to hear your opinion about using cloud functions vs the Firebase SDK. </p>

<p>My perspective on using the SDK is that, yes it's easier, but it's harder to test from an endpoint perspective, since there are no endpoints. I was thinking to do e2e testing with firebase-mock, if I decide to go with this approach. Another challenge I see with using the SDK, is that I will need to write the functions for the mobile app vs having 1 endpoint for both:web and mobile.</p>

<p>On the other hand, if I decide to go with cloud functions, I can test the endpoints but I'm concerned that the cold starts may slow down my UX. I'm reserving cloud functions just for document manipulations and transactional emails.</p>

<p>Thank you for your time and please correct me if my perspective is wrong.</p>

<p>Cheers!</p>
",https://stackoverflow.com/questions/57897748/cloud-functions-vs-firebase-sdk-for-web-project,"['firebase', 'google-cloud-firestore', 'google-cloud-functions']",77,False,1,0
"waitForElement Not JSON Response, when trying to access button element","<p>First of all, I'm quite new to NativeScript and e2e testing, but I'm trying to get some simple tests to run on my demo application. I did the whole setup where I installed everything and an e2e (default) folder + files were created.</p>

<p>I have this demo app layout where I basically have one button:</p>

<pre><code>&lt;ActionBar title=""My App"" class=""action-bar""&gt;
&lt;/ActionBar&gt;

&lt;GridLayout class=""page""&gt;
     &lt;StackLayout&gt;
        &lt;Button automationText=""testButton"" text=""Button""&gt;&lt;/Button&gt;
     &lt;/StackLayout&gt;
&lt;/GridLayout&gt;
</code></pre>

<p>These are my tests:</p>

<pre><code>import { AppiumDriver, createDriver, SearchOptions } from ""nativescript-dev-appium"";
import { assert } from ""chai"";

describe(""sample scenario"", () =&gt; {
    const defaultWaitTime = 5000;
    let driver: AppiumDriver;

    before(async () =&gt; {
        driver = await createDriver();
    });

    after(async () =&gt; {
        await driver.quit();
        console.log(""Quit driver!"");
    });

    afterEach(async function () {
        if (this.currentTest.state === ""failed"") {
           // await driver.logTestArtifacts(this.currentTest.title);
        }
    });

    it(""should find an element by text"", async () =&gt; {
        const btn = await driver.findElementByText(""Button"");
        assert.isTrue(btn.exists());
    });

    it(""should find an element by automation text"", async () =&gt; {
         const btn = await driver.findElementByAutomationText(""testButton"");
         assert.isTrue(btn.exists());
    });
});
</code></pre>

<p>I had to comment this line, otherwise, my tests wouldn't finish (I had to manually stop them with ctrl C):</p>

<pre><code>// await driver.logTestArtifacts(this.currentTest.title);
</code></pre>

<p>I am running it with:</p>

<pre><code>$ npm build ios
$ npm run e2e -- --runType sim.iPhone6
</code></pre>

<p>I am able to run stupid tests, assertTrue(true), but when I am trying to access an element, the button, things go wrong:</p>

<pre><code>    should find an element by text:
 [waitForElementByXPath(""//*[@label='Button' or @value='Button' or @hint='Button']"",5000)] [elements(""xpath"",""//*[@label='Button' or @value='Button' or @hint='Button']"")] Not JSON response
  Error: [elements(""xpath"",""//*[@label='Button' or @value='Button' or @hint='Button']"")] Not JSON response
  at exports.newError (node_modules/wd/lib/utils.js:151:13)
</code></pre>

<p>And:</p>

<pre><code> should find an element by automation text:
 [waitForElementByAccessibilityId(""testButton"",5000)] [elements(""accessibility id"",""testButton"")] Not JSON response
  Error: [elements(""accessibility id"",""testButton"")] Not JSON response
  at exports.newError (node_modules/wd/lib/utils.js:151:13)
</code></pre>

<p>I also tried to see if the driver was just empty or something like that, but isIOS and isAndroid work fine. </p>

<p>I don't know if this has something do to with it but when killing the driver this error also pops up:</p>

<pre><code>Error: [quit()] Unexpected data in simpleCallback.
</code></pre>

<p>If anybody could help that would be great! Thanks!</p>
",https://stackoverflow.com/questions/55473195/waitforelement-not-json-response-when-trying-to-access-button-element,"['appium', 'nativescript', 'e2e-testing']",340,False,1,1
&quot;Uncaught SyntaxError: Invalid or unexpected token&quot; occurs when running e2e test for the angular app using cypress framework,"<p>I'm using cypress to do e2e testing for our angular app, when cypress auto-open the app home page，the error occurs,and in the browser console print  ""Uncaught SyntaxError: Invalid or unexpected token"" just as show in the screenshot attached, it's seems messy code is catched  in the vendor.xxx.js file, but the file is auto compiled and generated by angular framework and is no problem in our everyday using.
The error it's not happening every time start running by cypress, and if I manually input the URL  into the browser to visit the application,this error will disappear, I'm not sure whether it's the cypress bug when it trigger or start the browser for test, after all it's the cypress framework manipulate the browser. The error happens in both built-in Eletron browser and chrome browser which controled by cypress. The version of cypress used is 3.4.0, I will be very appreciated if anyone try to give some advise,thanks.</p>
",https://stackoverflow.com/questions/57932141/uncaught-syntaxerror-invalid-or-unexpected-token-occurs-when-running-e2e-test,"['angular', 'automated-tests', 'e2e-testing', 'cypress']",2743,True,1,3
How to close the safari pop up dialogue when running automate script with nightwatch on BrowserStack?,"<p>I use Browserstack to do the E2E testing, now I met a problem when I try to run the mobile automate script in safari on Browserstack, there will have a pop-up dialogue show when I click a button which will result in opening a new tab, the dialogue show message like this: 'this site is attempting to open a popup window', I must close it and the script can continue executing.</p>

<p>Now the problem is:
1. When I click the button which will trigger this pop-up dialogue, there will always show an exception in the log: 'Error while running .clickElement() protocol action: Appium error: An unknown server-side error occurred while processing the command. Original error: Did not get any response after 20s'.
2. I can use the XPath to locate the button on the pop-up dialogue and click it to close the dialogue, but it takes serval minutes, is there another way to do this operation more efficient?</p>

<pre><code>const { client } = require('nightwatch-api')
const { Given, Then, When} = require('cucumber')

Given('open mobile 163 news', async function () {
    await client.url('https://3g.163.com/news/article/EJN99AOF000189FH.html?clickfrom=index2018_news_newslist#offset=0')
})

When('choose share by QQ', async function () {
    await client.waitForElementVisible('.sharelogo')
    await client.click('.sharelogo')
})

Then('the popup should show', async function () {
    await client.waitForElementVisible('.qzone')
    await client.click('.qzone')
    await client.setContext('NATIVE_APP')
    await client.source(function(res){
        console.log(res.value)
    })
    await client.useXpath()
    await client.click('//*[@name=""Allow""]')
    await client.contexts(function(result) {
        client.setContext(result.value[result.value.length - 1])
        client.useCss()
    })
})
</code></pre>
",https://stackoverflow.com/questions/56966072/how-to-close-the-safari-pop-up-dialogue-when-running-automate-script-with-nightw,"['browserstack', 'nightwatch']",523,True,0,1
Gitlab: Passing artefacts through jobs and stages,"<p>I use node.js mocha and selenium-webdriver for e2e testing.
I have different stages, like install, test button 1, test button 2.
Each stage (except install) have 2 jobs (for chrome and for safari).
My goal, in the end, get 1 txt file with tests results from all jobs of all stages.</p>

<p>I tried many different configurations:</p>

<ol>
<li>always pass artifact report.txt and run ./mocha >> report.txt in each job.

<ul>
<li>result in inconsistent data in the file (not all jobs write in, partially wroten etc.)</li>
</ul></li>
<li>always pass 2 artifacts report1.txt, report2.txt, so the job for chrome write only in #1, the job for the safari in #2

<ul>
<li>doesn't work at all, god knows why</li>
</ul></li>
<li>dependencies with 2 artifacts report1.txt, report2.txt

<ul>
<li>for some reason artifact node_modules which generates in install stage not passing to next stages.</li>
</ul></li>
</ol>

<p>I don't have examples anymore for this setups, they are messy, but I give you an example of my .gitlab-ci.yml maybe you can help me with it.</p>

<pre><code>stages:
  - install
  - startup
  - quality
  - language
  - report

.chrome_template: &amp;chrome_template
  environment:
    name: chrome
  variables: &amp;chrome_template_var
    SELENIUM_BROWSER: chrome
  tags:
    - ""macbook""

.safari_template: &amp;safari_template
  environment:
    name: safari
  variables: &amp;safari_template_var
    SELENIUM_BROWSER: safari
  tags:
    - ""macbook""

# install job

install:
  stage: install
  tags:
    - ""macbook""
  script:
    - npm install
  artifacts:
    paths:
      - node_modules/
  except:
    - tags

# testing jobs

.startup: &amp;startup
  stage: startup
  variables: &amp;startup-var
    SPEC: startup
  script:
    - npm run test
  retry: 1
  artifacts:
    when: on_failure
    paths:
      - screenshot

.quality: &amp;quality
  stage: quality
  variables: &amp;quality-var
    SPEC: quality
  script:
    - npm run test
  retry: 1
  artifacts:
    when: on_failure
    paths:
      - screenshot/

.language: &amp;language
  stage: language
  variables: &amp;language-var
    SPEC: language
  script:
    - npm run test
  retry: 1
  artifacts:
    when: on_failure
    paths:
      - screenshot/

startup:chrome:
  &lt;&lt;: *startup
  &lt;&lt;: *chrome_template
  variables:
    &lt;&lt;: *startup-var
    &lt;&lt;: *chrome_template_var

language:chrome:
  &lt;&lt;: *language
  &lt;&lt;: *chrome_template
  variables:
    &lt;&lt;: *language-var
    &lt;&lt;: *chrome_template_var

quality:chrome:
  &lt;&lt;: *quality
  &lt;&lt;: *chrome_template
  variables:
    &lt;&lt;: *quality-var
    &lt;&lt;: *chrome_template_var

startup:safari:
  &lt;&lt;: *startup
  &lt;&lt;: *safari_template
  variables:
    &lt;&lt;: *startup-var
    &lt;&lt;: *safari_template_var

language:safari:
  &lt;&lt;: *language
  &lt;&lt;: *safari_template
  variables:
    &lt;&lt;: *language-var
    &lt;&lt;: *safari_template_var

quality:safari:
  &lt;&lt;: *quality
  &lt;&lt;: *safari_template
  variables:
    &lt;&lt;: *quality-var
    &lt;&lt;: *safari_template_var

report:
  stage: report
  tags:
    - ""macbook""
  script:
    - cat *.txt &gt; report.txt
  artifacts:
    paths:
      - report.txt
</code></pre>
",https://stackoverflow.com/questions/54327670/gitlab-passing-artefacts-through-jobs-and-stages,"['node.js', 'gitlab', 'mocha.js', 'gitlab-ci']",1414,True,0,1
Protractor Locator for elements of same class,"<p>I'm new to Protractor and E2E testing and want to determine whether my approach to CSS locators is correct for identical elements of the same class. </p>

<p>I have an <a href=""https://www.w3schools.com/code/tryit.asp?filename=G1WTVA8EK3U8"" rel=""nofollow noreferrer"">HTML Fiddle here</a> that depicts a webpage with two div elements, each containing two buttons: the buttons are all of the same class. HTML follows:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
  &lt;div&gt;
    &lt;button class=""btn1"" tooltip=""Color""&gt;
              &lt;span class=""color-indicator"" style=""background-color: rgb(0, 0, 0);""&gt;
    &lt;/button&gt;
    &lt;button class=""btn1"" tooltip=""Background Color""&gt;
              &lt;span class=""color-indicator"" style=""background-color: rgb(50, 50, 50);""&gt;
    &lt;/button&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;button class=""btn1"" tooltip=""Color""&gt;
              &lt;span class=""color-indicator"" style=""background-color: rgb(0, 0, 0);""&gt;
    &lt;/button&gt;
    &lt;button class=""btn1"" tooltip=""Background Color""&gt;
              &lt;span class=""color-indicator"" style=""background-color: rgb(50, 50, 50);""&gt;
    &lt;/button&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I need to click each button element in each <code>div</code>. The buttons can be accessed by <strong>element(by.css())</strong> Locator using their CSS selectors (e.g. <strong>""body > div:nth-child(1) > button:nth-child(1)""</strong>) but is there a better way to access these items?</p>

<p>My website has many instances like this, and I'd like to know if there is a better way to access elements like this, other than hardcoding their <strong>nth-child</strong> numbers in my <strong>it()</strong> scripts. The elements on the webpages might be reordered in the future, and so using numbering might result in broken cases down the road.</p>

<p>Thank you :-)</p>
",https://stackoverflow.com/questions/55077564/protractor-locator-for-elements-of-same-class,"['html', 'css', 'typescript', 'protractor']",750,True,0,1
Why isn&#39;t Cucumber considered as a testing tool?,"<p>I'm new to Cucumber, and I'm trying to understand the tool. While reading <a href=""https://cucumber.io/docs/guides/overview/"" rel=""nofollow noreferrer"">the documentation</a>, I found that it is defined shortly as <strong>&quot;a tool that supports BDD&quot;</strong>:</p>
<blockquote>
<p>Cucumber is a tool that supports Behaviour-Driven Development(BDD).</p>
</blockquote>
<p>Also it is described as a &quot;validation tool&quot;:</p>
<blockquote>
<p>Cucumber reads executable specifications written in plain text and validates that the software does what those specifications say.</p>
</blockquote>
<p>In the other side, I noticed the excessive use of the word <strong>&quot;test&quot;</strong> on the <a href=""https://cucumber.io/docs/guides/10-minute-tutorial/"" rel=""nofollow noreferrer"">10-minute tutorial</a>.</p>
<p>AFAIK, what does this tool is agile testing, since it is used massively in e2e testing (test basis = Gherkin feature specs + step definitions). However, <a href=""https://cucumber.io/blog/where_should_you_use_bdd/"" rel=""nofollow noreferrer"">the blog</a> says something different:</p>
<blockquote>
<p>Finally, remember that Cucumber is <strong>not a testing tool</strong>. It is a tool for capturing common understanding on how a system should work. A tool that allows you, but doesn't require you, to automate the verification of the behaviour of your system if you find it useful.</p>
</blockquote>
<p>Now if this tool is not really about testing, then what use is it intended for?</p>
",https://stackoverflow.com/questions/58346431/why-isnt-cucumber-considered-as-a-testing-tool,"['testing', 'cucumber', 'bdd']",595,True,1,1
What&#39;s the difference between a UI test and an E2E Test? And What&#39;s the benefits of each?,"<p>Our team is considering starting testing based on user scenarios. So, we are picking a E2E framework.</p>

<p>Searching for <code>UI test</code> lead to the following:</p>

<p>So, I found this <a href=""https://stackoverflow.com/questions/40564794/what-is-the-difference-between-ui-gui-testing-functional-testing-and-e2e-testin"">this</a> </p>

<p>It says</p>

<p><strong>UI testing</strong>: user interface testing. In other words, you have to make sure that all buttons, fields, labels and other elements on the screen work as assumed in a specification.</p>

<p><strong>GUI testing</strong>: graphical user interface. You have to make sure that all elements on the screen work as mentioned in a specification and also color, font, element size and other similar stuff match design.</p>

<p><strong>Functional testing</strong>: the process of quality assurance of a product that assumes the testing of the functions/functionalities of component or system in general, according to specification requirements.</p>

<p><strong>E2E testing</strong>: it needs for identifying system dependencies and ensuring that the right information is passed through multiple components and systems.</p>

<p>I don't get the difference between <code>UI Testing</code> &amp; <code>E2E Testing</code>. </p>

<p>I wrote UI Test Code in Android Studio. And I need to write a code for each and every click and view, etc. I feel why do we need this? I'd rather test with my finger directly and dynamically. </p>
",https://stackoverflow.com/questions/57198214/whats-the-difference-between-a-ui-test-and-an-e2e-test-and-whats-the-benefits,"['android', 'unit-testing', 'e2e-testing', 'ui-testing', 'gui-testing']",8392,True,10,1
How to organize e2e tests for Spring app with RDS as a storage,"<p>We have a Spring Boot application, which uses RDS service for storing data (PostgreSQL, VPC + private subnet particularly) and Cognito for the user authentication. All this jazz is deployed in automation (Jenkins + CloudFormation). Now, we have a few end2end tests, checking that app is alive. The question is, should we go further and try to test the functionality, requiring some test user to be authorized. Personally, I would prefer it to be tested, but there are some obstacles which I don't know how to approach.</p>
<ul>
<li><p>Normally within e2e testing, you would like to have a clear DB at the beginning of each test (or a bunch of tests) with similar preconditions. For that, you apply a snapshot with the desired state of DB or simply drop all tables.</p>
<p>Is it possible to do it on the AWS (DB is not publicly accessible)? Am I supposed to use <a href=""https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBInstanceFromDBSnapshot.html"" rel=""nofollow noreferrer"">RestoreDBInstanceFromDBSnapshot command</a> for that or there are other ways to do this? How to prevent case when DB schema has changed, but we still restore from the old snapshot?</p>
</li>
<li><p>We can have special endpoints just for the test environment, but it is kind of unfavored because it messes up the code</p>
</li>
</ul>
",https://stackoverflow.com/questions/57884045/how-to-organize-e2e-tests-for-spring-app-with-rds-as-a-storage,"['amazon-web-services', 'amazon-rds', 'end-to-end']",274,True,2,1
DAX Intermittent No Endpoints Available,"<p>Scenario:</p>

<p>We have a streaming Java application that is performing read/write requests to DynamoDB via DAX with the most recent DAX client instance. When performing both simple integration tests and performance testing we intermittently see exceptions about no endpoints being available.</p>

<pre><code>com.amazonaws.AmazonClientException: Unable to call cluster endpoint: No endpoints available
at com.amazon.dax.client.dynamodbv2.ClusterDaxClient$ClusterReadRetryHandler.check(ClusterDaxClient.java:699)
at com.amazon.dax.client.dynamodbv2.ClusterDaxClient.invoke(ClusterDaxClient.java:649)
....    
IOException: No endpoints available
at com.amazon.dax.client.cluster.Cluster.readClient(Cluster.java:680)
at com.amazon.dax.client.dynamodbv2.ClusterDaxClient$2.getClient(ClusterDaxClient.java:138)
at com.amazon.dax.client.dynamodbv2.ClusterDaxClient.invoke(ClusterDaxClient.java:631)
... 23 more
</code></pre>

<p>To clarify, intermittent meaning that some requests will be successful, then some will fail, only to have the requests once again be successful all within a single test (integration or performance). In fact, the majority of these test runs will be successful w/out ever seeing this error but it does occasionally happen as described in the last sentence.</p>

<p>The dev instance of the DAX and DynamoDB are standing instances, meaning that running these tests does not re-infrastructure/deploy either the DAX or DynamoDB instances for a clean slate (they are left up and running between test runs).</p>

<p>Question:</p>

<p>Has anyone else seen a similar pattern of this intermittent behavior at small scale tests (e.g. integration/e2e testing) or larger scale testing (e.g. performance testing) with DAX? I know that this has been discussed on other tickets for scenarios where people cannot ever connect to DAX, but there has been no issues or scenarios that I have seen identifying intermittent behavior like this.</p>
",https://stackoverflow.com/questions/55521984/dax-intermittent-no-endpoints-available,"['java', 'amazon-dynamodb', 'amazon-dynamodb-dax']",928,False,7,0
How to solve the error: Failed: Error while waiting for Protractor to sync with the page,"<p>I have an e2e testing using protractor. My test involves angular page and non-angular page. I have no problem to test on non-angular page. But I have an error when the test finished on the non-angular page and back to angular page. </p>

<p>My test starts from a home page(angular page) and click login button. This will redirect to a non-angular page. Finish typing username and password, then redirect to angular page again. I have issue on the last step when test back to angular page.</p>

<pre><code>beforeAll(() =&gt; {
    page = new Abcflow();
});

fdescribe('step 1', () =&gt; {
   beforeEach(async () =&gt; await page.navigateToStart());

    fit('login as staff and come back to home page', async () =&gt; {
    //start from an angular page
    await page.clickButton('a', 'Login / Register');

    //now in a non-angular page
    browser.driver.findElement(by.id('Email')).sendKeys('email');
    browser.driver.findElement(by.id('Password')).sendKeys('password');
    browser.driver.findElement(by.name('button')).click();

    //navigate back to angular page
    await page.navigateToStart();

    expect(await page.getPageTitleText()).toEqual('abc title');
  });
});
</code></pre>

<p>I can see my test page came back from non-angular page to the angular page. Then I got error like</p>

<ul>
<li>Failed: Error while waiting for Protractor to sync with the page: ""both angularJS testability and angular testability are undefined.  This could be either because this is a non-angular page or because your test
involves client-side navigation, which can interfere with Protractor's bootstrapping.  See <a href=""https://github.com/angular/protractor/issues/2643"" rel=""nofollow noreferrer"">https://github.com/angular/protractor/issues/2643</a> for details""</li>
</ul>

<p>I have tried to add the lines:</p>

<pre><code>browser.ignoreSynchronization = true;
browser.waitForAngularEnabled(false);
</code></pre>

<p>Then I got another error said ""No element found using locator"". The funny thing is if I don't test the login page and just go for the last line, it will pass successfully. Seems like the angular page tests stopped working after navigating from non-angular page.</p>
",https://stackoverflow.com/questions/54242064/how-to-solve-the-error-failed-error-while-waiting-for-protractor-to-sync-with,"['angular', 'webdriver', 'protractor', 'e2e-testing']",3435,True,2,2
How to check if a repository has files for which a clean/smudge filter is set up that haven’t been processed?,"<p>I’ve introduced <code>git-lfs</code> on a project fairly recently, and we’ve been hitting some PEBKACs where builds would produce bad output that manifests in non-obvious ways. The culprit was assets that are stored in Git-LFS - the build was grabbing the pointer files.</p>

<p>Can I detect that I have such files in the repository - because git-lfs hasn’t been installed, or because fetching the files failed - so I can blow up the build?</p>

<hr>

<p>(For some additional context: the assets in question are PouchDB / Leveldown database files. The app needs a bunch of read-only data, and there’s enough of it that initializing the indexes if it’s loaded from JSON on first start is unacceptably slow, so we just want to ship the full pre-built DB. This is about 300MB data that needs updating like once or twice a year, so it’d soon baloon a clone to over a GB of mostly useless binaries, so I’m shoving it into LFS. Vexingly, since this a first-start optimization, the bug won’t manifest during regular development - if there’s any data in the app’s storage dir it’ll use that; eventually I’ll get around to setting up appropriate E2E testing of builds and add some sort of checksum to avoid bootstrapping with corrupted data, but for now I’d like something quick and dirty I can fail a build on immediately.)</p>
",https://stackoverflow.com/questions/58907288/how-to-check-if-a-repository-has-files-for-which-a-clean-smudge-filter-is-set-up,"['git', 'git-lfs']",46,False,1,0
"Unit and e2e testing with NestJS, TypeORM on Mysql and Passport module","<p>I'm currently taking over a backend written with NestJS, typeorm on Mysql and passport package for authentication. I'm currently trying to write both unit and e2e tests according to the NestJS documentation but I can't really make it work.</p>

<p>I've tried both importing the root AppModule or a single module. 
In the first case, it complains that it cannot connect to the database. I've overridden the configs provider for that, made it work on a testing Sqlite database, still passport module will raise an error saying that cannot access property challenge of undefined.</p>

<p>So, let's start with e2e testing, here is my app module:</p>

<pre><code>
  imports: [
    ConfigModule,
    CoreModule,
    Logger,
    AuthModule,
    TypeOrmModule.forRootAsync({
      imports: [TypeOrmConfigService],
      useClass: TypeOrmConfigService,
    }),
    UsersModule,
    CoreModule,
    DataModule,
    InitializationModule,
    TokensModule,
    ProjectsModule,
    ReportsModule,
    AccountsModule,
    NotificationModule,
    FaqModule,
    StrategicModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
</code></pre>

<p>and here is my e2e-spec file in which i override the config service to setup a temporary database:</p>

<pre><code>class MockTypeOrmConfigService implements TypeOrmOptionsFactory {
  createTypeOrmOptions(): TypeOrmModuleOptions {
    return {
      type: 'sqlite' as any,
      database: ':memory:',
      synchronize: true,
      dropSchema: true,
      entities: [`../src/**/*.entity{.ts,.js}`],
    };
  }
}
const mockTypeOrmConfigService = new MockTypeOrmConfigService();

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

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

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

  it('/faq (GET)', () =&gt; {
    return request(app.getHttpServer())
      .get('/faq')
      .expect(200)
      .expect('Hello World!');
  });
});
</code></pre>

<p>this would actually work if only a big part of my schema definition is based on mysql fields (for example json, composite autoincrement and blobs). 
So my next tentative would be to use single controller modules to create the app and run e2e tests there. 
Let's say I have this controller:</p>

<pre><code>@Controller('faq')
@UseGuards(AuthGuard())
@ApiBearerAuth()
export class FaqController {
  constructor(private readonly faqService: FaqService) {}

  @Get()
  @ApiOkResponse({ type: FaqEntryDto, isArray: true })
  async getAll(): Promise&lt;FaqEntryDto[]&gt; {
    return this.faqService.findAll();
  }

  @Post()
  @UseGuards(new RolesGuard(UserRole.Admin))
  async create(@Body() body: FaqEntryDto) {
    return this.faqService.create(body);
  }

  @Put('/:id')
  @UseGuards(new RolesGuard(UserRole.Admin))
  async update(
    @Param('id', new ParseIntPipe()) id: number,
    @Body() body: FaqEntryDto
  ) {
    return this.faqService.update(id, body);
  }

  @Delete('/:id')
  @UseGuards(new RolesGuard(UserRole.Admin))
  async delete(@Param('id', new ParseIntPipe()) id: number) {
    return this.faqService.delete(id);
  }
}
</code></pre>

<p>and this my test (in which I also override the repository provider:</p>

<pre><code>ntroller (e2e)', () =&gt; {
  let app: INestApplication;

  beforeAll(async () =&gt; {
    const moduleFixture = await Test.createTestingModule({
      imports: [FaqModule],
      providers: [FaqService],
    })
      .overrideProvider(getRepositoryToken(FaqEntity))
      .useValue({})
      .compile();

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

  it('/ (GET)', () =&gt; {
    return request(app.getHttpServer())
      .get('/faq')
      .expect(200)
      .expect('Hello World!');
  });
});
</code></pre>

<p>then, I would always get messages from the passport auth module, for instance:</p>

<pre><code>[Nest] 4976   - 8/29/2019, 8:27:00 AM   [ExceptionHandler] In order to use ""defaultStrategy"", please, ensure to import PassportModule in each place where AuthGuard() is being used. Otherwise, passport won't work correctly.
[Nest] 4976   - 8/29/2019, 8:27:00 AM   [ExceptionHandler] Cannot read property 'challenge' of undefined +44ms
TypeError: Cannot read property 'challenge' of undefined
</code></pre>

<p>I also tried with <code>overrideGuard</code> on <code>AuthGuard</code> but the result is exactly the same.</p>

<p>Additionally I would like to use typeorm-fixture package but also on this front I'm having big trouble.</p>
",https://stackoverflow.com/questions/57695246/unit-and-e2e-testing-with-nestjs-typeorm-on-mysql-and-passport-module,"['javascript', 'node.js', 'passport.js', 'nestjs', 'typeorm']",5623,True,1,1
Running Nighwatch.js with Babel 7 @babel/register,"<p>I have a <code>client</code> repository with React 15.3, Webpack 4, and Babel 7. Webpack works as a charm, but our E2E testing suite using Nightwatch 0.9.20 fails to compile with the new <code>@babel/register</code> package.</p>

<p>Our company is upgrading our babel version from 6 to 7.</p>

<p>Floating around the internet a solution to add the following to the <code>babel.config.js</code> file:</p>

<pre><code>{
  ""presets"": [
    [
      ""@babel/preset-env"",
      {
        ""modules"": ""commonjs"",
        ""targets"": {
          ""node"": ""current""
        }
      }
    ]
  ],
  ""plugins"": [
    ""add-module-exports"",
  ]
}
</code></pre>

<p>In our instance, this solution doesn't resolve our problem.</p>

<p>I should mention the structure of the project is as follows:</p>

<pre><code>client // where nightwatch is run from the terminal
  |-- tests // our E2E tests
  |-- nightwatch.conf.js
  |-- nighwatch_globals.js
  |-- babel.config.js

api // a completely separate repository
  |-- tests // we store factory definitions here as well
  |-- db
       |-- models // also a frequently referenced directory in our E2E tests

</code></pre>

<p>Our nightwatch.conf.js structure looks like this:</p>

<pre><code>require('@babel/register')(); // this has been upgraded from 'babel-register'
require('dotenv').config();

...

module.exports = {
  // nightwatch configurations

  ""globals_path"": ""./nightwatch_globals.js"",

  // more nightwatch configurations
}

</code></pre>

<p>Our <code>nightwatch_globals.js</code> file (where the error is being called looks like this:</p>

<pre><code>import fetch from 'isomorphic-fetch';

module.exports = {
  reporter: function(results, cb) {
    fetch('http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer').then(() =&gt; {
      cb();
      if (
        (typeof(results.failed) === 'undefined' || results.failed === 0) &amp;&amp;
          (typeof(results.error) === 'undefined' || results.error === 0)
      ) {
          process.exit(0);
      } else {
          process.exit(1);
      }
    });
  },
  // give the db some time to finish ops from previous test before
  // clearing db and starting the next test
  before: function(done) {
    require('./../eka-api/test/factories/index.js');
    done();
  },
  beforeEach: function(done) {
    setTimeout(function() {
      done();
    }, 5000);
  },
};

</code></pre>

<p>And our <code>babel.config.js</code> file is the following:</p>

<pre><code>
module.exports = function(api) {
  api.cache(true);

  const presets = [
    ""@babel/preset-env"",
    ""@babel/react"",
    ""@babel/preset-flow"",
  ];

  const plugins = [
    ""@babel/plugin-syntax-flow"",
    ""@babel/transform-flow-strip-types"",
    [""@babel/plugin-proposal-decorators"", {""legacy"": true}],
    // react hot loader must come before class properties plugin
    ""react-hot-loader/babel"",
    // class properties plugin must come after decorators
    // if decorators has a 'legacy' attribute, class properties must be loose
    [""@babel/plugin-proposal-class-properties"", {""loose"" : true}],
    ""@babel/plugin-transform-runtime""
  ];

  return {
    presets,
    plugins
  };
};
</code></pre>

<p>From the client directory I run in the terminal <code>node nightwatch.conf.js ; nightwatch</code></p>

<p>Here is the persisting error</p>

<pre><code>/Users/myUser/Documents/api/test/factories/index.js:1
(function (exports, require, module, __filename, __dirname) { import bluebird from 'bluebird';
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Module._compile (/Users/myUser/Documents/eka-client/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (module.js:580:10)
    at Object.newLoader [as .js] (/Users/myUser/Documents/eka-client/node_modules/pirates/lib/index.js:104:7)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
</code></pre>

<p>My intuition tells me that the reason why the import token is not recognized has to do with how Babel 7 is scoping the compilation of code down to the <code>process.cwd()</code>. As you see the error is coming from the api. Since nightwatch is a package in the client directory, Babel isn't compiling the api directory (which is still on Babel 6). However, I'd like to avoid having to refactor our entire client testing suite to be independent of the api files. </p>

<p>I suspect the solution is to find a way for <code>@babel/register</code> to compile the api from the client side, but I don't know how I'd go about doing something like this.</p>
",https://stackoverflow.com/questions/56640388/running-nighwatch-js-with-babel-7-babel-register,"['babeljs', 'nightwatch.js', 'babel-register']",2780,False,0,0
AWS Codebuild - Can one access last git commit message from codebuild buildspec?,"<p>In a few of my codepipelines, I have set up E2E testing with cypress/mocha/mochawesome-reporter to run tests in the post-build section of my codebuild. Then, I added a --recursive line (see below) to take all the report materials out of the build and move them into a timestamped (see : ""$(date +""%Y%m%d-%H%M"")"") directory in an s3 bucket. I wanted to know if there is a way to access the last commit message (perhaps as an environmental variable or otherwise?) and add that to the name of my timestamped directory. I have read through a lot of the documentation but only see environmental variables which allow you to pull out git ID/Hash.</p>

<p>I know you can see the last commit message in the ""Source"" portion of your codepipeline (via webhooks), so maybe there is a way to propagate that information through to the build section? </p>

<p>Further info : The codepipelines are triggered by webhooks seeing a new push to my repo. </p>

<p>Have read documentation. Tried adding ""printenv"" in the codebuild, and then when I watched the tail logs come in, I didn't see any commit messages I could pull out. </p>

<pre><code> post_build:
    commands:
       - npm run ci
       - aws s3 mv mochawesome-report s3://XXX-BUCKET/reports/XXX-PRODUCT/$(date +""%Y%m%d-%H%M"") --recursive
</code></pre>

<p>I expect there might be some possible way to pull the last git commit message out, maybe that last line in my code examples would look like : </p>

<ul>
<li>aws s3 mv mochawesome-report s3://XXX-BUCKET/reports/XXX-PRODUCT/$(date +""%Y%m%d-%H%M"")CODEBUILD_SRC_GIT_COMMIT_MSG?? --recursive</li>
</ul>
",https://stackoverflow.com/questions/56450454/aws-codebuild-can-one-access-last-git-commit-message-from-codebuild-buildspec,"['git', 'amazon-web-services', 'github', 'aws-codepipeline', 'aws-codebuild']",3121,True,2,1
"nrwl-Nx and Cypress, verification timing out with failed --smoke-test in Windows 7","<p>I'm trying to follow along with <a href=""https://nx.dev/tutorial/02-add-e2e-test"" rel=""nofollow noreferrer"">this tutorial</a> on the NX website.  The 2nd part has us setting up e2e testing with Cypress.  I followed everything as said and even went as far as commenting out my code and pasting theirs into my files.  I'm not getting any errors in the console.  The error I see in Node says</p>
<blockquote>
<p>Cypress verification timed out</p>
<p>This command failed with the following output:</p>
<p>C:.....\Cache\3.3.1\Cypress\Cypress.exe --smoke-test --ping=852</p>
</blockquote>
<p>The tutorial also says there's a UI that should pop up on our app, which I don't see anything of the sort.</p>
<p>After generating the workspace and the application it has us modify the <code>app.po.ts</code> file by adding a couple constants, so far mine looks like this</p>
<pre><code>export const getGreeting = () =&gt; cy.get('h1');
export const getTodos = () =&gt; cy.get('li.todo');
export const getAddTodoButton = () =&gt; cy.get('button#add-todo');
</code></pre>
<p>next it tells us to update the <code>app.spec.ts</code> file of the e2e test by adding this</p>
<pre><code>import { getAddTodoButton, getTodos } from '../support/app.po';

describe('TodoApps', () =&gt; {
  beforeEach(() =&gt; cy.visit('/'));

  it('should display todos', () =&gt; {
    getTodos().should(t =&gt; expect(t.length).equal(2));
    getAddTodoButton().click();
    getTodos().should(t =&gt; expect(t.length).equal(3));
  });
});
</code></pre>
<p>The version of this file generated by <code>Nx</code> comes with this already in it</p>
<pre><code>import { getGreeting } from '../support/app.po';

describe('todos', () =&gt; {
  beforeEach(() =&gt; cy.visit('/'));

  it('should display welcome message', () =&gt; {
    getGreeting().contains('Welcome to todos!');
  });
});
</code></pre>
<p>I originally tried adding the extra test underneath it and added the new imports.  After getting the error message I thought maybe I needed to combine the tests into one test which looks like this.</p>
<pre><code>describe('TodoApps', () =&gt; {
    beforeEach(() =&gt; cy.visit('/'));

    it('should display welcome message', () =&gt; {
    getGreeting().contains('Welcome to todos!');
  });

  it('should display todos', () =&gt; {
    getTodos().should(t =&gt; expect(t.length).equal(2));
    getAddTodoButton().click();
    getTodos().should(t =&gt; expect(t.length).equal(3));
  });
});
</code></pre>
<p>I'm still getting the same error in Node and have no clue as to what I'm doing wrong.  Prior to starting the project I updated <code>node</code>, <code>npm</code> and <code>angular cli</code>.  I downloaded <code>Angular Console</code> for <code>VS Code</code> but am running into problems with it so I've just been using the Node Terminal and Brackets.  Can anyone help?</p>
",https://stackoverflow.com/questions/56554552/nrwl-nx-and-cypress-verification-timing-out-with-failed-smoke-test-in-windows,"['node.js', 'typescript', 'angular-cli', 'cypress', 'nrwl-nx']",3162,True,1,1
Replacing a setTimeout() in an Angular Reactive Form with an Observable,"<p>I want to replace a setTimout() with an Observable in an Angular reactive form.</p>
<p>I have a grandchild component that serves a section of a larger reactive form, receives an array of data objects from an API endpoint, packs that data into a Form Array, and submits it to the form.  This works well.</p>
<p>The problem is that the asynchronous nature of our API endpoints causes the form data of this grandchild component to render old data before the new data can initialize itself and clear out the old data and repopulate the new data.  We've solved this with a setTimout() of 500 ms.  It works well on the front end.</p>
<p>The problem is that the setTimeout() is causing issues with our e2e testing failing because it completes the test before the data is loaded. Plus, a timeout is not a long term solution to this async issue... especially if the data could occasionally take longer than 1/2 second (not a usual case, but definitely plausible).</p>
<p>I'm hoping to replace my timeout with an observable as a better solution that won't block our tests and can handle async much more safely.  Problem is that I cannot get the observable to work and I'm still an RxJS novice.</p>
<p>Here is the original function with the timeout that is currently running:</p>
<pre><code>setTimeout(() =&gt; {
      this.dataRow = [];
      for (let item of this.data.row) {
        this.dataRow.push(item);
      }
    }, 500);
</code></pre>
<p>Here is my attempt to recreate with an Observable:</p>
<pre><code>this.dataRow = [];
   this.dataEmitter = from(this.data.row).pipe(delay(1000)).subscribe(data =&gt; this.dataRow.push(data);)
</code></pre>
<p>My code creates a data stream, but doesn't seem to work the same as the timeout.  How can I accomplish this?  Is this even the correct way to approach this problem?</p>
",https://stackoverflow.com/questions/56135845/replacing-a-settimeout-in-an-angular-reactive-form-with-an-observable,"['javascript', 'angular', 'typescript', 'rxjs']",2637,True,3,2
"Image shows 1 thing, but queried data shows another when loading a website","<p>I was trying to query a website: <code>const url = ""https://personal.vanguard.com/us/FixedIncomeHome""</code> with the hope to automate some functionality within puppeteer.</p>

<p>I noticed if i create a screen shot: <code>page.screenshot(""preclick.png"")</code> it will show the page data with tabs.  When i try to follow it up with a query, it seems to not return the second tab (denoted by the following selector: <code>a[container=""CD""]</code></p>

<pre><code>const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto(url, {waitUntil: 'networkidle2'})
page.screenshot(""start.png"")
page.evaluate( () =&gt; {
    document.querySelectorAll(""a[container='CD']"")[0].click()
})
///...
</code></pre>

<p>and i dont really know why this is the case.  Ideally, i am trying to click CD and then click an empty search.  I noticed that since session ids are tracked, I wanted to do this as a sort of E2E test in order to get the resulting table data.</p>

<p>I see that the Content of tab etc is dynamically loaded, so somehow there is an issue with the page being able to query.</p>

<p>I was attempting something else to see what would occur, waiting for the tag to appear, BUT it would just timeout after 30 seconds:</p>

<pre><code>await page.waitForSelector(""a[container='CD']"").then( async resolve =&gt; {
     page.execute( () =&gt; document.querySelector(""a[container='CD']"").click() );
});
</code></pre>

<p>I dont know why the screenshot shows the HTML, but when attempting to query for it from within execute it fails.  It doesnt make sense to me why this occurs.  Ideally, I want to click CD tab, then i want to click Search, then i want to loop through the 20 results in the table.</p>

<p><em>EDIT</em> I was noticing that evaluate was not querying the component correctly because of an iframe.  If i want to develop e2e testing though, i assumed there was a way to somehow get a reference to the button and click it, or simulate a click.*</p>
",https://stackoverflow.com/questions/59038608/image-shows-1-thing-but-queried-data-shows-another-when-loading-a-website,"['javascript', 'html', 'node.js', 'puppeteer']",55,True,1,1
Show Jasmine screenshots in Azure DevOps test results,"<p>I'm testing my application with e2e testing with Protractor and Jasmine. The code is on Azure DevOps and automatically builds and runs the tests.
Azure is so great, that you can actually generate test results with graphics when your test results are in a JUnit, xUnit,.. format. </p>

<p>I installed the protractor-jasmine2-screenshot-reporter because I want to be able to show screenshots when a test failed. Locally on my pc it works great. Every time the screenshots are generated and put in the right place. It generates .png files and one .html file. In the html there is a reference to the .png files.</p>

<p><a href=""https://i.stack.imgur.com/tBQoC.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/tBQoC.png"" alt=""example of screenshots output""></a></p>

<p>Now here is the problem: the screenshots are bundled in html but azure cannot form html into test results.</p>

<p>How can I let jasmine convert it to a format Azure will read, or how can I insert the screenshots in Azure without Azure complaining he can't read it?
I was already able to show test results generated by a jasmine reporter that generated a .xml file, this was not a problem. But getting screenshots/html into Azure DevOps...</p>

<p>Even if I could just attach an attachment to the tests with screenshots, would already be great.</p>

<p>I've looked everywhere on the internet for two days into three possibilities:</p>

<ol>
<li>Maybe there is a plugin that will take screenshots and in some way include this in an xml Azure will read. Unfortunately I only can find plugins that generate html. </li>
<li>I tried to find a way that I could get Azure to accept an attachment of some kind or accept html, but it seems it won't.</li>
<li>I searched for ways to convert html to xml but I only seem to find the other way around.</li>
</ol>

<h2>General question:</h2>

<p>How can I show screenshots on the test results of tfs. For example in the Attachments (as shown in picture).</p>

<p><a href=""https://i.stack.imgur.com/0jouo.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/0jouo.png"" alt=""picture of where I want the screenshots to come""></a></p>
",https://stackoverflow.com/questions/56734331/show-jasmine-screenshots-in-azure-devops-test-results,"['jasmine', 'azure-devops', 'protractor', 'azure-pipelines']",1537,True,2,1
Firebase/Firestore Testing Pattern: mock fake data without code duplication (DRY),"<p>This is a question about programming style and patterns when it comes to writing tests for complex systems written in Firebase/Firestore. I'm writing a web app using Firebase, Typescript, Angular, Firestore, etc...</p>

<p><strong>Objective:</strong>
I have written basic security rules tests to test my <code>users</code> collection. I'll also be testing the function that writes the document, and e2e testing that the document is written when a new user signs up. So far so good.</p>

<p>The tests are clean so far - I manually define a few user objects, write it to the database before the tests with <code>beforeEach()</code> and run the tests. The tests depend on me knowing what data I wrote in the first place - what were the document ids, what were the field values etc... and then I check for certain operations to pass, certain operations to fail, depending on the custom claims provided. Similarly, with functions tests and e2e tests, I'll be checking if correct data was written, generated, etc...</p>

<p>The next step would be to test the chat functionality. Here's where I run into code duplication issues.</p>

<p><strong>Issue:</strong>
So let's say I want to test the chat functionality or the transaction functionality. For these modules to be tested, the database needs to have fake user data, transaction data, test data etc... and, furthermore, within the tests, I need to have access to the fields, document Ids, etc.. that were written to the database, so I can access the documents for tests, etc...</p>

<p>For example, whether or not a chat message can be written to firestore depends on whether certain fields exist on the user document.</p>

<p>This would require me to manually define all the objects I plan to write to the database in the same file as the tests themselves, so I have access to what I wrote. As I test more complex and dependent modules of the system, since each test for each module is in a separate file, I either have to manually write out each object, or require it from another test file and write it. Each document has its payload and its Id that I need to keep track of, and even the fake user token objects I have to pass to firestore (or actual auth user records I have to import for online testing). This would mean a whole bunch of boilerplate code and duplication simply writing objects as such in all of my files:</p>

<pre class=""lang-js prettyprint-override""><code>const fakeUserPayload: User = {
  handle: 'username',
  email: faker.internet.email(),
  ...etc
}
// And so on and on for all test users, chat docs, transaction docs, etc...
</code></pre>

<p><strong>Potential Solution:</strong> so there are a few potential solutions I came up with, but none seem to solve the problem. 
For example, I thought I would write a module that simply populates the firestore database at the start of each test. The module would have a <code>userPayloadFactory</code> and other loops (using <code>faker</code> module) to automatically populate the Db with fake data.</p>

<p><strong>Problem:</strong> If I did this, I wouldn't have access to the document Ids and field data in my tests, since it's automatically generated. I thought, maybe I could populate firestore with fake data, and then use an administrative db connection to read the fake user documents and their Ids back into the tests, and then use this data to conduct the tests. For example, I would find the user id and then generate a chat document and test for correct data / success. Except it seems incredibly messy to write data in one module and then read it back in another, especially since most tests require a specific document to be written to test for certain cases/scenarios. Which makes auto-populated mock data useless - so we're back to square one, where I have to manually define and write out a large number of fake objects in order to test rules, functions and functionality.</p>

<p><strong>Potential Solution</strong>: I could maybe keep auth and firestore data in a JSON backup file, (so they remain static) and import them into the database with a shell command before each test suite. However, this has its own issues as it's not easy to dynamically generate new test cases or edge cases, and also difficult to continually re-export and update the JSON backup files as the project grows.</p>

<p>What is a better way to structure and write my tests so that I can automatically generate the documents and payloads I need, while having control and access over what gets written?</p>

<p>I'm hoping there's some kind of factory or pattern that can make this easier, scalable and more consistent and robust.</p>
",https://stackoverflow.com/questions/59433290/firebase-firestore-testing-pattern-mock-fake-data-without-code-duplication-dry,"['firebase', 'unit-testing', 'google-cloud-firestore', 'firebase-security']",968,True,0,1
