intern

Getting “Error: failed to connect to tunnel VM” with intern/saucelabs

一曲冷凌霜 提交于 2019-12-10 11:48:22
问题 I'm just starting out with intern/saucelabs. Whenever I try a remote test, I'm getting Error: failed to connect to tunnel VM. My intern.js has environments: [ { browserName: 'firefox', version: '28'}, ], tunnel: 'SauceLabsTunnel', tunnelOptions: { username: 'foo', accessKey: 'xxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxx' }, Execution log $ intern-runner config=theintern/intern-sauce.js Listening on 0.0.0.0:9000 Starting tunnel... Using no proxy for connecting to Sauce Labs REST API. *********************

Intern: loop on Promise.<Array.<leadfoot/Element>>

一个人想着一个人 提交于 2019-12-10 10:23:18
问题 Let's say I have the following DOM structure, for simplicity: <div class='myparent'> <div class='child'> <div class="label">A</div> <div class="ico"/> </div> <div class='child'> <div class="label">B</div> <div class="ico"/> </div> <div class='child'> <div class="label">C</div> <div class="ico"/> </div> </div> I would like to loop within all child Element returned by the function findAllByCssSelector('.child'). In particular, I would click on the ico div subelement ONLY if the label of the div

How to switch iframes InternJS

我怕爱的太早我们不能终老 提交于 2019-12-08 08:33:15
问题 I need to switch to an iframe that has a dynamic name and id. <iframe name="easyXDM_1435765828615" id="easyXDM_1435765828615">...</iframe> I noticed LeadFoot has a switchToFrame() function, but when I pass it an element that was returned from find() I get the error "MoveTargetOutOfBounds: POST http.../moveto / {"element":"16"} Offset within element cannot be scrolled into view". Is there a better way to do this using execute() and some javascript, or how can I make switchToFrame() work? 回答1:

Local functional tests start after more then 1 minute

ぐ巨炮叔叔 提交于 2019-12-07 20:18:09
问题 I have the same tests, the same selenium-server-standalone (2.43.1) and chromedriver (2.10). I have only functional tests (no unit tests). My Chrome is at version 37. My OSX is at version 10.9.5. Java version is 1.7.0_51 (Java 7 update 67). When I run tests a new Chrome instance is opened with an empty tab: With intern 1.7.0 tests start in less then 10 seconds. With intern 2.1.1 tests start in 55-60 seconds. Selenium logs look like this (when run by intern 2.1.1): 01:26:50.195 INFO -

Intern JS - how can I use Promise.all() within chained Command methods?

时光毁灭记忆、已成空白 提交于 2019-12-07 14:30:01
问题 I am new to writing tests with Intern JS and have been following their documentation to use the Object interface and Page objects, particularly. According to the docs, the idea behind page objects is to encapsulate the DOM for a particular page, in case of the markup changing. In attempting to follow the page object pattern, my goal is to have a method on myPage which uses Promise.all() to find several DOM elements, and then return these to an actual test function. I'm roughly basing this on

Can't get Intern to run Node.js Module

淺唱寂寞╮ 提交于 2019-12-07 01:58:24
问题 I am trying to test Intern to see if it would be a good fit for a testing framework. I am trying to test the following code in Intern. var HelloWorld; HelloWorld = (function () { function HelloWorld (name) { this.name = name || "N/A"; } HelloWorld.prototype.printHello = function() { console.log('Hello, ' + this.name); }; HelloWorld.prototype.changeName = function(name) { if (name === null || name === undefined) { throw new Error('Name is required'); } this.name = name; }; return HelloWorld; }

How to switch iframes InternJS

浪尽此生 提交于 2019-12-06 20:42:24
I need to switch to an iframe that has a dynamic name and id. <iframe name="easyXDM_1435765828615" id="easyXDM_1435765828615">...</iframe> I noticed LeadFoot has a switchToFrame() function, but when I pass it an element that was returned from find() I get the error "MoveTargetOutOfBounds: POST http.../moveto / {"element":"16"} Offset within element cannot be scrolled into view". Is there a better way to do this using execute() and some javascript, or how can I make switchToFrame() work? Depending on how your iframes are setup on the page you could try something like this: .switchToFrame(null)

How do you specify test suites in Intern using a wildcard?

北城余情 提交于 2019-12-06 11:28:26
I have a bunch of unit tests in this folder: src/app/tests/ . Do I have to list them individually in intern.js or is there a way to use a wildcard? I've tried suites: [ 'src/app/tests/*' ] but that just causes the test runner to try to load src/app/tests/*.js . Do I really have to list each test suite individually? The common convention is to have an all module which collects your test modules, e.g.: define([ './module1', './module2', // ... ], function(){}); Then you simply list the all module in the suites array, like this: suites: [ 'src/app/tests/all' ], Generally this is no different from

Remote debugging Internjs that runs on selenium chromedriver

会有一股神秘感。 提交于 2019-12-06 03:19:37
问题 I try to remotely debug tests run by Internjs. Basically it is a Chrome that is run by Selenium and Chromedriver. I set up Chromedriver debuggerAddress option as debuggerAddress: '127.0.0.1:8765' Now when I run tests Selenium waits some time and than fails with message: FATAL ERROR UnknownError: [POST http://localhost:4444/wd/hub/session / {"desiredCapabilities":{"browserName":"chrome","name":"tests/intern_local","idle-timeout":60,"selenium-version":"2.44.0","chromeOptions":{"debuggerAddress"

深入解析String#intern

核能气质少年 提交于 2019-12-06 02:12:38
引言 在 JAVA 语言中有8中基本类型和一种比较特殊的类型String。这些类型为了使他们在运行过程中速度更快,更节省内存,都提供了一种常量池的概念。常量池就类似一个JAVA系统级别提供的缓存。 8种基本类型的常量池都是系统协调的,String类型的常量池比较特殊。它的主要使用方法有两种: 直接使用双引号声明出来的String对象会直接存储在常量池中。 如果不是用双引号声明的String对象,可以使用String提供的intern方法。intern 方法会从字符串常量池中查询当前字符串是否存在,若不存在就会将当前字符串放入常量池中 接下来我们主要来谈一下String#intern方法。 intern的实现原理 首先深入看一下它的实现原理。 1.JAVA 代码 /** * Returns a canonical representation for the string object. * <p> * A pool of strings, initially empty, is maintained privately by the * class <code>String</code>. * <p> * When the intern method is invoked, if the pool already contains a * string equal to this