title,body,link,tags,view_count,is_answered,score,answer_count
Should I avoid testing on live data for acceptance testing?,"<p>My team is transitioning into using BDD and cucumber. We are creating acceptance tests and from what I understand we want to be high level, happy path type tests that are hitting our features end to end as a user would.</p>
<p>How do we:</p>
<ol>
<li>Ensure the changing data on a live environment won't cause tests to have false failures?</li>
<li>Protect changes deployed to an environment from impacting all customers if things go wrong?</li>
</ol>
<p>Alternatively we've considered having a sterile, repeatable database that we could use for the app to run against. However, then how would we:</p>
<ol>
<li>Ensure that we don't miss features failing because the data isn't representative of live data.</li>
<li>Avoid testing too closely to implementation rather than behavior</li>
</ol>
<p>I would love to get some pointers on best practices here.</p>
",https://stackoverflow.com/questions/73806897/should-i-avoid-testing-on-live-data-for-acceptance-testing,"['cucumber', 'bdd']",34,True,-2,2
"Imitate Keycloak user creation/login/deletion via API, for acceptance testing purposes","<p>I have a microservices-based application secured by Keycloak. To carry out API-level acceptance and platform testing.  I would like to emulate as closely as possible the creation/login/deletion of a user account from the point-of-view of the user - without creating/controling a browser, headless or otherwise.</p>
<p>I realise I can directly carry out these operations by creating a realm client with client credentials but I would like to avoid this since:</p>
<ul>
<li>it does not closely emulate the interactions I'm seeking to test</li>
<li>it presents a potential security risk in giving an outside entity rights to edit and delete accounts which it doesn't own.</li>
<li>When running against production it potentially allows the tests to accidentally edit/delete real accounts.</li>
</ul>
<p>As far as I understand, the closest way to emulate these actions would be to imitate the http requests carried out by the Keycloak user web interface. I imagine I could reverse-engineer these via browser development tools but but was wondering if there was a less time-consuming and brittle alternative</p>
<ul>
<li>Are these http requests documented anywhere?</li>
<li>Is there an alternative API which directly models thse interactions?</li>
</ul>
",https://stackoverflow.com/questions/74530260/imitate-keycloak-user-creation-login-deletion-via-api-for-acceptance-testing-pu,"['api', 'testing', 'keycloak', 'bdd']",54,False,0,0
Uploading test results to DevOps,"<p>I'm brand new to DevOps.  For user acceptance testing, I want end-users to record [manual] test results on a spread sheet rather than having them entering the results directly in DevOps.  The end-users are not tech savy but they can use Excel.  I know I can do a bulk import of test cases - is there a way to import executed test cases with actual results as well?  Something like:
[Sample .csv import template] (<a href=""https://i.stack.imgur.com/c5oaW.png"" rel=""nofollow noreferrer"">https://i.stack.imgur.com/c5oaW.png</a>)</p>
<p>Thanks!</p>
<p>I've imported test cases but can't figure out if it's possible to add columns to indicate execution results as well.</p>
",https://stackoverflow.com/questions/74529820/uploading-test-results-to-devops,['azure-devops'],55,True,0,1
Gitlab CI runner - How do I delete apache vhost after UAT is done?,"<p>Please in my gitlab-ci.yml, for instance, I want to have a cleanup that would help me each time a job is run successfully during Acceptance testing. All file generated in my server, I will like to purge and restart apache.</p>
<pre><code>stages:
- build
- cleanup_build
- test
- deploy
- cleanup

build_job:
  stage: build
  script:
  - make build

cleanup_build_job:
  stage: cleanup_build
  script:
  - cleanup build when failed
  when: on_failure

test_job:
  stage: test
  script:
  - make test

deploy_job:
  stage: deploy
  script:
  - make deploy
  when: manual

cleanup_job:
  stage: cleanup
  script:
  - cleanup after jobs
  when: always

</code></pre>
<p>In global main.yml, I have something like to create a vhost for each test in my ansible. On job completion, I want to remove the vhost created during the UAT. It is long file and I can't be sharing all the configurations here. Ultimately, what I want to do is how to handle clause to know when a CI runner is done successfully then a call to the script to trigger removal of the vhost.</p>
",https://stackoverflow.com/questions/72594062/gitlab-ci-runner-how-do-i-delete-apache-vhost-after-uat-is-done,"['gitlab', 'gitlab-ci-runner']",28,False,0,0
500 error and not details when running jest supertest with express,"<p>I'm trying to add jest acceptance testing into an API repo (currently there are jest unit tests).  The app is serverless aws.  I'm working on getting a rough working p.o.c. API test against a staging url and I've put together this test file but it isn't working as expected and I don't have details to go on.  I'd like to know how to return more details for a failure or what I'm missing to get it to hit the route as expected.</p>
<p>I'm returning 500 errors, but no real extra details.  If I input an empty/invalid jwt token - still returns 500.  If I remove the expect(response.status).toEqual(200); it &quot;passes&quot; but the console.log(&quot;blah blah blah here&quot; + response); fails to show the response (or the &quot;blah blah blah&quot; for that matter).  How can I return more details to see what I may be missing?  Or adjust my request so it successfully hits that route and returns a better response?</p>
<p>My auth_impersonation p.o.c. test</p>
<pre><code>import { agent as request } from 'supertest';
import express = require('express');

describe('Impersonate SE merchant', () =&gt; {
  let app: express.Application = express();
  let jwtToken = 'string I'm putting in manually for now';

  it('returns a valid access token', async () =&gt; {
// within it block attempts here (below)

    const response = await request(app)
      .get('full staging url string here')
      .auth(jwtToken, {type: 'bearer'}); 
      console.log(&quot;blah blah blah here&quot; + response);
    // expect(response.status).toEqual(200);
  })
});
</code></pre>
<p>Here's how the request looks in postman where the route works
<a href=""https://i.stack.imgur.com/ftPpC.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/ftPpC.png"" alt=""enter image description here"" /></a></p>
<p>Another go of the postman request, headers
<a href=""https://i.stack.imgur.com/lX6uI.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/lX6uI.png"" alt=""enter image description here"" /></a></p>
",https://stackoverflow.com/questions/74398781/500-error-and-not-details-when-running-jest-supertest-with-express,"['express', 'jestjs', 'serverless', 'acceptance-testing']",641,False,0,0
Running test on .feature file in VSCode returning odd characters in terminal,"<p>I am currently testing a few features for an app and going through the BDD acceptance testing process at the moment. My questions is aiming to receive for an explanation rather than an answer.</p>
<p>I have written my scenarios using the GWT syntax in a .feature file. Then I created the test file for this .feature file and ran a test on it while it contained an empty defineFeature() function in order to receive the code for my tests from Cucumber in the terminal.</p>
<p>Now, in the code that has been returned to me in the terminal I get some odd characters. In this case those characters represent a number from the .feature file. I added two screenshots for reference.</p>
<p><a href=""https://i.stack.imgur.com/HRp6J.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/HRp6J.png"" alt=""enter image description here"" /></a></p>
<p><a href=""https://i.stack.imgur.com/LQtwv.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/LQtwv.png"" alt=""enter image description here"" /></a></p>
<p>I don`t have any Gherkin related extensions installed and have also checked all my setting but nothing is related to this syntax. My currenty workaround is to simply rephrase the GWT so that I receive plain letter characters only.</p>
<p>Here is my package.json:</p>
<pre><code>{
  &quot;name&quot;: &quot;app name&quot;,
  &quot;version&quot;: &quot;0.1.0&quot;,
  &quot;private&quot;: true,
  &quot;homepage&quot;: &quot;https://example.com&quot;,
  &quot;dependencies&quot;: {
    &quot;@testing-library/jest-dom&quot;: &quot;^5.16.4&quot;,
    &quot;@testing-library/react&quot;: &quot;^13.3.0&quot;,
    &quot;@testing-library/user-event&quot;: &quot;^13.5.0&quot;,
    &quot;axios&quot;: &quot;^0.27.2&quot;,
    &quot;nprogress&quot;: &quot;^0.2.0&quot;,
    &quot;react&quot;: &quot;^18.2.0&quot;,
    &quot;react-dom&quot;: &quot;^18.2.0&quot;,
    &quot;react-scripts&quot;: &quot;5.0.1&quot;,
    &quot;web-vitals&quot;: &quot;^2.1.4&quot;,
    &quot;workbox-background-sync&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-broadcast-update&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-cacheable-response&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-core&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-expiration&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-google-analytics&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-navigation-preload&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-precaching&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-range-requests&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-routing&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-strategies&quot;: &quot;^6.5.3&quot;,
    &quot;workbox-streams&quot;: &quot;^6.5.3&quot;
  },
  &quot;scripts&quot;: {
    &quot;start&quot;: &quot;react-scripts start&quot;,
    &quot;build&quot;: &quot;react-scripts build&quot;,
    &quot;test&quot;: &quot;react-scripts test&quot;,
    &quot;eject&quot;: &quot;react-scripts eject&quot;,
    &quot;predeploy&quot;: &quot;npm run build&quot;,
    &quot;deploy&quot;: &quot;gh-pages -d build&quot;
  },
  &quot;eslintConfig&quot;: {
    &quot;extends&quot;: [
      &quot;react-app&quot;,
      &quot;react-app/jest&quot;
    ]
  },
  &quot;browserslist&quot;: {
    &quot;production&quot;: [
      &quot;&gt;0.2%&quot;,
      &quot;not dead&quot;,
      &quot;not op_mini all&quot;
    ],
    &quot;development&quot;: [
      &quot;last 1 chrome version&quot;,
      &quot;last 1 firefox version&quot;,
      &quot;last 1 safari version&quot;
    ]
  },
  &quot;devDependencies&quot;: {
    &quot;@wojtekmaj/enzyme-adapter-react-17&quot;: &quot;^0.6.7&quot;,
    &quot;enzyme&quot;: &quot;^3.11.0&quot;,
    &quot;gh-pages&quot;: &quot;^4.0.0&quot;,
    &quot;jest-cucumber&quot;: &quot;^3.0.1&quot;,
    &quot;puppeteer&quot;: &quot;^14.4.1&quot;
  }
}

</code></pre>
<p>What might be the reason for this syntax?</p>
",https://stackoverflow.com/questions/72718587/running-test-on-feature-file-in-vscode-returning-odd-characters-in-terminal,"['jestjs', 'cucumber', 'bdd', 'acceptance-testing']",42,False,0,1
UIPath: How to find texted hyperlink on website and click on it,"<p>I am faced with user acceptance testing a website used in a previous project.  I want to find the texted hyperlink and click on it based on a value extracted from excel.  The text, as well as the position of the hyperlink changes on each iteration.</p>
<p>I found the solution!</p>
<p>Make use of a click text activity.  When indicating the element on the screen make sure you select the whole element where the search is required.  In my case it returned this 'col-md-10' value at the webctrl class but I don't know if it will be applicable to everyone.  The second and most important thing to look at that kept me busy for a while is the OffsetX and OffsetY properties in the properties pane.  You will see that when running the process the cursor will move to the correct place to click BUT it will fall short (either not up enough or to left etc).  This is because the center pixels of the activity and HTML differ.  Play around with the offset. In my case all it needed was a '-20' at the OffsetY property.<a href=""https://i.stack.imgur.com/WUYR0.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/WUYR0.png"" alt=""This is the website I automated and wanted to click on the hyperlinked zone names"" /></a>
<a href=""https://i.stack.imgur.com/lmCeR.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/lmCeR.png"" alt=""The webctrl class value"" /></a></p>
",https://stackoverflow.com/questions/74220434/uipath-how-to-find-texted-hyperlink-on-website-and-click-on-it,"['hyperlink', 'click', 'full-text-search', 'uipath', 'rpa']",573,False,1,2
What is the difference between deployment environment and code branch?,"<p><strong>Intro</strong></p>
<p>I'm working on an application that has different deployment environments:</p>
<ul>
<li>DEV (development)</li>
<li>UAT (user acceptance testing)</li>
<li>PROD (production)</li>
</ul>
<p>I understand that development for a new release happens in DEV, is pushed to UAT for testing and then pushed to PROD for actual usage. Different environments are used to makes sure that developers can play around and make errors without disturbing actual users of the application.</p>
<p>However I'm a bit confused about what happens when a &quot;hotfix&quot; (=bug that needs to be fixed urgently) is required. A colleague told me that in this case the code of the PROD environment is &quot;branched&quot; and pushed to DEV. When the bug is fixed on dev, the branch is pushed further to UAT and finally PROD again. Even if there were already some developments for a next release in DEV, then still this work would not be lost as the &quot;hotfix&quot; is done on a different &quot;branch&quot;.</p>
<p><strong>Question</strong></p>
<p>Is the following understanding, relating to the difference between deployment environments and code branches, correct?</p>
<ul>
<li>A code branch is just a copy of a codebase that starts living a separate life until it is merged with the main code branch again.</li>
<li>A deployment environment is an environment that has code, a database for the code to interact with and computing power to execute the code.</li>
</ul>
<p>The difference is thus mainly that the deployment environment has a database and computation power on top of the pure &quot;code&quot;.</p>
",https://stackoverflow.com/questions/71926641/what-is-the-difference-between-deployment-environment-and-code-branch,"['deployment', 'branch']",1014,True,2,1
