e2e-testing

Simulate drag and drop of file to upload in Protractor

牧云@^-^@ 提交于 2020-07-18 14:01:50
问题 I want to test file upload, by dragging file to the drop zone in the page, however I can't find a way to simulate file dragging from the desktop folder. The only way I managed to found is the following one - desktop.browser.actions().dragAndDrop(elem,target).mouseUp().perform();(Protractor) However as far as I can understand, it drags only css element. 回答1: This is a working example to simulate a file drop from the desktop to a drop area: const dropFile = require("./drop-file.js"); const EC =

Cypress e2e testing - How to get around Cross Origin Errors?

女生的网名这么多〃 提交于 2020-07-17 10:13:19
问题 I'm testing a web app that integrates Gmail, Slack, Dropbox etc. I'm trying to write end to end tests with Cypress.io to verify that auth flows are working. Cypress restricts me from navigating outside my app's domain and gives me a Cross Origin Error. The Cypress docs say that testing shouldn't involve navigating outside your app. But the entire purpose of testing my app is to make sure these outside auth flows are functioning. The docs also say you can add "chromeWebSecurity": false to the

Cypress e2e testing - How to get around Cross Origin Errors?

你。 提交于 2020-07-17 10:12:46
问题 I'm testing a web app that integrates Gmail, Slack, Dropbox etc. I'm trying to write end to end tests with Cypress.io to verify that auth flows are working. Cypress restricts me from navigating outside my app's domain and gives me a Cross Origin Error. The Cypress docs say that testing shouldn't involve navigating outside your app. But the entire purpose of testing my app is to make sure these outside auth flows are functioning. The docs also say you can add "chromeWebSecurity": false to the

How can I clear a Codemirror editor field from Cypress

时光总嘲笑我的痴心妄想 提交于 2020-07-07 05:44:17
问题 I already tried something like this from another SO answer How to type using cypress .type() inside the codemirror editor? If it helps this is the site I am working on Cypress with https://testing-playground.com/ // CodeMirror's editor doesn't let us clear it from the // textarea, but we can read the Window object and then // invoke `setValue` on the editor global cy.window().then(win => { win.editor.setValue("") }) The issue I am running into is when I try to implement this I am getting

Need Help to check if element is in current Viewport with Testcafe

白昼怎懂夜的黑 提交于 2020-07-05 07:57:09
问题 I'm trying to implement a custom method to find out if the element is in the current view port Below is the snippet of code that I've tried to implement but the outcome does not render the boolean result: export const isElementInViewport = () => { const getBoundValues = ClientFunction(() => document.querySelectorAll(".hero-getstart").item(0).getBoundingClientRect()); const windowHeight = ClientFunction(() => window.innerHeight); const windowWidth = ClientFunction(() => window.innerWidth);

Testcafe live not running

牧云@^-^@ 提交于 2020-06-15 09:25:51
问题 I am on OsX, using nvm, node 10.15.3. Testscafe (not live) works fine, but I was trying to follow the instructions at Testcafe-live At the step where it explains how to install it locally If you have installed testcafe-live locally to your project, add an npm script to package.json to run tests: it refers to a package.json file, I added the entry under the scripts section "scripts": { "test": "eslint ./**/*.js", "testcafe-live": "testcafe-live chrome tests/" }, but when I run npm run testcafe

How to make post request with data in test-cafe?

老子叫甜甜 提交于 2020-06-15 06:44:24
问题 I am a beginner in api-testing, I'm using test-cafe and I have written test to make a GET request using RequestHook which is working fine, I was able to get the data but when I'm trying to make the POST request using the same RequestHook and I'm unable to send the data when making a request as it needs to be of type buffer. I can't convert the data of type JSON to buffer. While making a POST request. I want to know whether this is the correct way to make a POST request using RequestHook or do

Cypress: run only one test

天涯浪子 提交于 2020-06-09 09:32:23
问题 I want to toggle only running one test, so I don't have to wait for my other tests to see the result of one test. Currently, I comment out my other tests, but this is really annoying. Is there a way to toggle only running one test in Cypress ? 回答1: to run only one file cypress run --spec path/to/file.spec.js or using glob patterns: cypress run --spec 'path/to/files/*.spec.js' Note: you need to wrap your glob patterns in single quotes to avoid shell expansion! to run only one test in a file

Protractor Conditional Selector

亡梦爱人 提交于 2020-06-08 12:37:53
问题 I am using Selenium Protractor and want to select all elements from the following list except one that contains text "Cat" and then perform some operations on the remaining ones. <div class="mainDiv"> <div class="childDiv">Dog</div> <div class="childDiv">Goat</div> <div class="childDiv">Bird</div> <div class="childDiv">Cat</div> <div class="childDiv">Zebra</div> </div> Is there a selector by cssContainingText (or some other) in which I can give a condition to select all elements except the

Protractor: Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined

半城伤御伤魂 提交于 2020-05-14 18:42:13
问题 I am trying to write some end to end tests and waned to use async and await. configuration file exports.config = { framework: 'jasmine', seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['spec.js'], SELENIUM_PROMISE_MANAGER: false, getPageTimeout: 10000, multiCapabilities: [ { browserName: 'firefox' }, { browserName: 'chrome' } ] } spec file describe('home-view', function(){ beforeEach(async function(){ await browser.get('http://localhost:49335/index.html#!/home'); }); it('sorted by