e2e-testing

Testcafe wont recognise React

别来无恙 提交于 2020-03-21 17:59:24
问题 I'm trying to run my first testcafe test but it's proving arduous. testcafe -e chrome client/routes/Lookup/components/testcafe/lookup-test.js SyntaxError: client/routes/Lookup/components/Lookup.js: Unexpected token (60:8) 58 | if (error.status && error.status !== 404) { 59 | return ( > 60 | <NetworkIssues code={error.status} /> | ^ 61 | ); 62 | } 63 | at Object.<anonymous> (client/routes/Lookup/components/testcafe/lookup-test.js:1:1) lookup-test.js import Lookup from '../Lookup'; import React

How to fill an input field using Puppeteer?

*爱你&永不变心* 提交于 2020-03-17 04:29:39
问题 I'm using Puppeteer for E2E test, and I am now trying to fill an input field with the code below: await page.type('#email', 'test@example.com'); It worked, but I found the email address was typed into the field one character by one character as if a real human being was typing. Is it possible to fill the input field with the email address all at one time? 回答1: Just set value of input like this: await page.$eval('#email', el => el.value = 'test@example.com'); Here is an example of using it on

Protractor - self-signed ssl headless test e2e don't pass

笑着哭i 提交于 2020-03-05 03:05:59
问题 We have e2e test with Protractor. When I execute the script in my local machine it will pass. Now I have to integrate it with Jenkins system and docker. My webpage re-directs to another login page due to SSO. So I started with an url like this: https://demop-staging-ppd.com and this demop will me send to sso page with another url. When I write script to test if am I on the exact page, it will not pass because this page: I think the problem is we used self ssl certification. this is my conf.js

Protractor - self-signed ssl headless test e2e don't pass

邮差的信 提交于 2020-03-05 03:05:50
问题 We have e2e test with Protractor. When I execute the script in my local machine it will pass. Now I have to integrate it with Jenkins system and docker. My webpage re-directs to another login page due to SSO. So I started with an url like this: https://demop-staging-ppd.com and this demop will me send to sso page with another url. When I write script to test if am I on the exact page, it will not pass because this page: I think the problem is we used self ssl certification. this is my conf.js

How to share a global variable between test files from a test in TestCafe?

余生颓废 提交于 2020-02-04 06:36:54
问题 I'm manually setting auth cookies for my login purpose and I would like to share the Auth token across my tests. The very first time I have to perform a login in a test and then I have to save the auth token in a variable and share it across the test files. Here is the code snippet to explain what and how I'm trying to do: loginTest.js : let authToken = null; fixture`Login test` .page(inputData.url) .beforeEach(async (t) => { const nextMonth = new Date(); nextMonth.setMonth(nextMonth.getMonth

How to login in Auth0 in an E2E test with Cypress?

邮差的信 提交于 2020-02-03 03:46:26
问题 I have started testing a react webapp but I didn't go far because I had issues with the login. I am using cypress e2e testing tool. A welcome page is shown with a button to login, which will redirect you to auth0 service. User is login with email and password , then is redirected back to the webapp with a token. I tried many different approach each of them resulting in a different problem. Note: I don't want to test Auth0, I just want to enter in my webapp. Attempt 1. Clicking on login button

TestCafe: User Role logs out the user in the first test

大城市里の小女人 提交于 2020-01-24 20:38:06
问题 I'm trying to implement User Role in my existing tests as I don't want to login in every tests. Here is what my tests look like: const accountUser = Role('https://localhost:9000', async (t) => { await t.wait(1000); await loginPage.login(inputData.emailId, inputData.password); }, { preserveUrl: true }); fixture`login-test` .meta('testingType', 'regression') .requestHooks(mock) test('Add a person', async (t) => { await t.useRole(accountUser); await loginPage.goToPeopleList(inputData

Using cypress with vuetify

非 Y 不嫁゛ 提交于 2020-01-24 08:25:10
问题 I have a Vue.js project (Nuxt.js) and as UI I use the Vuetify. For e2e testing I use the Cypress. Below is my scenarios of test in Cypress: I have a problem while creating test for page where I use v-autocomplete component. The problem is that I can't use Vuetify native classes to get the element I want to test. below is an example with data-cy selector <v-autocomplete v-model="model" :items="items" item-text="Description" item-value="API" label="Public APIs" placeholder="Start typing to

Customize TestCafe Selector in TypeScript for Shadow root Element

ぐ巨炮叔叔 提交于 2020-01-21 14:38:10
问题 Please help me to define Selector part in TypeScript import { Selector, t } from 'testcafe' fixture `Scenario Name : Validation` .page `https://chrisbateman.github.io/guide-to-web-components/demos/shadow-dom.htm`; const demoPage = Selector('#demo1'); const paragraph = Selector(() => { return demoPageSelector().shadowRoot.querySelectorAll('p'); }, { dependencies: { demoPageSelector: demoPage } }); test('Test ShadowDom', async t => { await t .expect(paragraph.value).eql('Some text'); }); 回答1:

Breaking out of a Protractor .filter() or .map() loop

北慕城南 提交于 2020-01-20 08:43:56
问题 I'm using Protractor and cucumber framework; how do I break out of a .filter or .map loop? I do not want to continue to iterate further if I found a match! Page.prototype.getElementByKey = function (key) { var foundElement = null; return someElement.all(by.css('.someClass')).map(function (rawItem, index) { var itemObject = new ItemObjectClass(rawItem); return itemObject.getItemKey().then(function (foundItemKey) { var matched = String(foundItemKey).trim() === String(key).trim(); console.log('