quaint-flag-79692
01/26/2023, 3:37 AMcypress open
causes the following error:
It looks like this is your first time using Cypress: 12.4.0
√ Verified Cypress! C:\Users\me\AppData\Local\Cypress\Cache\12.4.0\Cypress
Opening Cypress...
[31056:0125/222133.282:ERROR:gpu_process_host.cc(969)] GPU process launch failed: error_code=18
[31056:0125/222133.303:ERROR:display_layout.cc(563)] PlacementList must be sorted by first 8 bits of display_id
[31056:0125/222133.376:ERROR:gpu_process_host.cc(969)] GPU process launch failed: error_code=18
[31056:0125/222133.451:ERROR:display_layout.cc(563)] PlacementList must be sorted by first 8 bits of display_id
[31056:0125/222133.515:ERROR:gpu_process_host.cc(969)] GPU process launch failed: error_code=18
[31056:0125/222134.922:ERROR:gpu_process_host.cc(969)] GPU process launch failed: error_code=18
[31056:0125/222135.084:ERROR:gpu_process_host.cc(969)] GPU process launch failed: error_code=18
[31056:0125/222135.222:ERROR:gpu_process_host.cc(969)] GPU process launch failed: error_code=18
[31056:0125/222135.405:ERROR:gpu_process_host.cc(969)] GPU process launch failed: error_code=18
Error: ERR_FAILED (-2) loading 'http://localhost:59953/__launchpad/index.html'
at rejectAndCleanup (node:electron/js2c/browser_init:165:7500)
at EventEmitter.stopLoadingListener (node:electron/js2c/browser_init:165:7875)
at EventEmitter.emit (node:events:527:28) {
errno: -2,
code: 'ERR_FAILED',
url: 'http://localhost:59953/__launchpad/index.html'
}
I'm running on Windows 11, using node.js v16.13.0. I used jest on my old laptop but when I moved to my new laptop, it started giving me similar GPU-related failures, which I have had no luck in getting rid of. I was hoping I could use Cypress instead but it appears to be giving me the same trouble. Can anyone help diagnose this?shy-minister-18411
01/26/2023, 6:33 AMbest-window-49967
01/26/2023, 9:48 AMstraight-microphone-66008
01/26/2023, 11:14 AMcolossal-umbrella-95675
01/26/2023, 11:25 AMcy.prittyTheme().menuItemOpen(1)
or cy.pritty.menuItemOpen(1)
. where menuItemOpen() is a new command for every theme. Is this possible? And so how or does anyone have a reference to documentation how i could make this? Thanks in advance! If not how do you deal with multiple theme's?stocky-intern-86590
01/26/2023, 12:19 PMsome-electrician-52054
01/26/2023, 1:24 PMERROR in src/app/xxx....xxx.service.ts:1471:37 - error TS2339: Property 'remove' does not exist on type 'MyClass[]'.
I configured the typeRoots in my tsconfig.json to tell TS about my extension method remove for arrays:
json
"typeRoots": [
"node_modules/@types",
"app/extensions/@types" <--- contains remove
],
Has anybody had the same issue? Is a configuration missing? As I mentioned before, these errors don't effect the functionality of the test run, but it's a bit annoying to have hundreds of them in the output.sparse-napkin-20893
01/26/2023, 2:58 PMfast-france-85428
01/26/2023, 3:09 PMfaint-ocean-92094
01/26/2023, 3:19 PMstocky-insurance-27750
01/26/2023, 3:33 PMimport { icons } from '../../../folder/folder2/folder3/file.vue'
but get errors stating Module not found /component-tests/e2e/Atoms/folder/folder2/folder3/file.vue
I've tried a few other ways too, but always end up with this error. It's looking within the cypress directory only and not stepping back out as I expect it to.brave-address-8775
01/26/2023, 4:18 PMstale-lifeguard-39024
01/26/2023, 7:18 PMrough-coat-99762
01/26/2023, 9:18 PMbest-lunch-5240
01/27/2023, 10:15 AMcy.request()
globally to avoid setting it up multiple times.
Here https://lightrun.com/answers/cypress-io-cypress-default-headers-for-cyrequest-command#:~:text=As%20a%20workaround%20I%20overwrite%20cy.request%20method%20with%20my%20custom%20command%3A
I found some potential way to do it.
So in my support/commands.ts
I have:
Cypress.Commands.overwrite('request', (originalFn, ...options) => {
const optionsObject = options[0];
if (optionsObject === Object(optionsObject)) {
optionsObject.headers = {
authorization: `Bearer ${Cypress.env('authorizationToken')}`,
...optionsObject.headers,
};
return originalFn(optionsObject);
}
return originalFn(...options);
});
And in the test I have:
cy.request({
method: 'POST',
url: '/someEndpoint',
body: someBody
}).then(response => {
expect(response.status).eq(200);
return response.body;
});
And unfortunately, I get 401: Unauthorized error and it looks like the authorization bearer token was not added to headers:
What do I do wrong here? I use Cypress v 10.10.0alert-author-4919
01/27/2023, 1:24 PMit("Should verify status", () => {
login(usuario.user);
cy.visit("arp/");
var status = JSON.parse(localStorage.getItem("@AXS-login") || "");
var ultimo = status.Cards.pop();
var state = JSON.stringify(ultimo.status_arp);
console.log(state);
cy.request({
method: "POST",
url: "https://dev-iris.axsenergia.com.br/csp/representante/login/",
header: "Content-Type: application/json",
header: "accept: application/json",
body: {
email: "versebank@teste.com",
senha: "teste123",
},
}).then((response) => {
expect(response.status).to.equal(200);
expect(state).to.equal('"Aguardando Aceite"')
});
});
it("After checks, exclude card", () => {
cy.wait(2000);
var card = JSON.parse(localStorage.getItem("@AXS-Energia:LastIdCard") || ""); //<- on this guy
cy.log("Card capturado: "+ card)
cy.request({
method: "POST",
url: "https://api.pipefy.com/graphql",
auth: {
bearer:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ1c2VyIjp7ImlkIjozMDIwMTgxMDQsImVtYWlsIjoiaGVucmlxdWUuc2F2aUBicGx1cy5jb20uYnIiLCJhcHBsaWNhdGlvbiI6MzAwMjE0OTM4fX0.Wxt8GX-pVkEpuZSH4dIVKlNXsQJ38PW1SLTLCP0h9D9nsIwjBaqmJvQcHx4V0AweCBReRyUr8kpz6h6pRLSw4Q",
},
header: "Content-Type: application/json",
header: "accept: application/json",
body: {
query:
"mutation{ deleteCard(input:{id: " +
card +
"}) { clientMutationId success }}",
},
}).then((response) => {
expect(response.status).to.equal(200);
});
cy.log("Card deleted successfully")
});
square-ability-8372
01/27/2023, 6:33 PMmammoth-energy-72910
01/27/2023, 7:13 PMbright-noon-82211
01/29/2023, 3:08 PMroot/
.env
.git
frontend/
src/
cypress/
.env -> The CYPRESS_RECORD_KEY variable is located here
cypress.config.ts
package.json
backend/
...
In the cypress.config.ts I added this to load the correct .env:
dotenv.config({ path: `.env` });
dotenv.config();
And now when I run cypress using npm run cypress-test
which runs cypress run --record
I get the error You passed the --record flag but did not provide us your Record Key.
Can I get any help?
- I tried adding the dotenv setup into plugins/index.ts
- I tried adding the variables to cypress.env.json in the frontend folder.
The only thing that seems to work is passing the env variables in the run command it self.great-oil-15113
01/30/2023, 9:01 AMechoing-controller-6107
01/30/2023, 9:10 AMlittle-byte-59792
01/30/2023, 10:01 AMRunning: registration/registration.cy.ts (26 of 38)
<--- Last few GCs --->
[1842:0x7fc7b8008000] 569883 ms: Mark-sweep 4051.8 (4143.5) -> 4036.2 (4144.0) MB, 1933.5 / 0.0 ms (average mu = 0.119, current mu = 0.015) allocation failure scavenge might not succeed
[1842:0x7fc7b8008000] 571794 ms: Mark-sweep 4045.7 (4144.0) -> 4036.2 (4144.0) MB, 1536.6 / 0.0 ms (average mu = 0.155, current mu = 0.196) allocation failure GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x101b7f5f5 node::Abort() (.cold.1) [path/to/node/v16.18.1]
2: 0x100874f49 node::Abort() [path/to/node/v16.18.1]
3: 0x10087512e node::OOMErrorHandler(char const*, bool) [path/to/node/v16.18.1]
4: 0x1009ec3f0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [path/to/node/v16.18.1]
5: 0x1009ec3b3 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [path/to/node/v16.18.1]
6: 0x100b90095 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [path/to/node/v16.18.1]
7: 0x100b940dd v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [path/to/node/v16.18.1]
8: 0x100b909bd v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [path/to/node/v16.18.1]
...
Documentation says :
## Memory
* 4GB minimum, 8GB+ for longer test runs
https://docs.cypress.io/guides/getting-started/installing-cypress#Memory
What does longer test run means?
I see a warning:
Trace: The new-window event is deprecated and will be removed. Please use contents.setWindowOpenHandler() instead.
at Object.log (node:electron/js2c/browser_init:225:603)
Who can help?
Cypress 12.4.1
npm 16.18.1brief-kite-35331
01/30/2023, 2:07 PMnpm audit
command I get this result (check the attachment)
How can I resolve this issue?
I already tried upgrading to the newest version of the got library and moving from the deprecated version of grep to cypress/grep.
Nothing helped 😞gifted-gold-39106
01/30/2023, 2:53 PMsilly-student-97216
01/30/2023, 4:46 PMgifted-tomato-54665
01/30/2023, 6:07 PMblue-scientist-74268
01/30/2023, 6:24 PMfaint-ocean-92094
01/30/2023, 8:39 PMon('task', {
executeSql (sql, ...args) {
return new Promise(async (resolve, reject)) => {
try {
let connection = await mysqlssh.connect(
{
host: "thisismyhostthatImnotsharing"
user: "supersecretuser"
privateKey: fs.readFileSync('cypress/fixtures/bd-ssh-key/id_rsa')
},
{
host: "mysqlhost"
user: "mysqluser"
password: "mysqlpassword"
database: "mysqlDatabase"
});
let result = await connection.promise().query(sql, args);
mysqlssh.close();
resolve(result[0][0]);
} catch (err) {
reject(err);
}
});
}),
})
This is working perfectly fine locally because I have my SSH key file in the provided location privateKey: fs.readFileSync('cypress/fixtures/bd-ssh-key/id_rsa')
The problem is that I can't commit this key into the repo. And what it has been requested is that I create a github secret with this key, and call it from there using ${{ secret.SSH_KEY }}
I have absolutely no idea how to do this.
I though of storing the key in a variable, and passing it on as an argument in the execution command but it didn´t work. Any ideas?elegant-noon-34773
01/30/2023, 9:22 PM"types": ["cypress", "@testing-library/cypress", "node" ]
faint-ocean-92094
01/30/2023, 9:28 PM