testing

phpunit : how to get the count of tests in a test directory without running test

喜你入骨 提交于 2019-12-25 07:11:50
问题 I would like to statically get a count of number of tests in a directory. Is there something available that I can use? Phpunit seems to have a count before test runs say 0/100 and increments it as the test completes. I would like to fetch that number before hand and exit the run possibly. 回答1: The --count-tests option of phploc can give you, just like the grep / wc -l line shown above, an estimate of the number of tests. Due to data providers, for instance, there cannot be an exact number

Using -Dspring.config.name and -Dspring.config.location in gradle test command line

六月ゝ 毕业季﹏ 提交于 2019-12-25 07:03:05
问题 I am able to use -Dspring.config.name and -Dspring.config.location in my Spring Boot application successfully. And now want to use same -Dspring.config.location to pass to Gradle test task. It seems to be not working for me. Although I can pass other system property and use in my test classes. I want to use this to run my tests in different environment. I know that Spring profile can be used. any help would be appreciated Edit: using -Dspring.config.name=app-test and/or -Dspring.config

What is the difference between should and must in scala testing? [duplicate]

五迷三道 提交于 2019-12-25 06:28:04
问题 This question already has an answer here : In ScalaTest is there any difference between `should`, `can`, `must` (1 answer) Closed 3 years ago . Both scalatest and Specs2 have separate matchers for should and must . However, I cannot find any explanation for why you would use one or the other. What exactly is the difference? 回答1: There is no difference, this is purely a syntactic preference. I personally prefer to use must in specs2 because I think that should can make people think that an

Comparing two websites in two windows using selenium webdriver and python

断了今生、忘了曾经 提交于 2019-12-25 06:06:22
问题 I need to test two websites using selenium webdriver on python. My goal is to make and save changes on one website and then see if the other website changed content accordingly. I want to make a change, then switch to a different window with a different website, then back and forth multiple times. Is it possible? Thank you! 回答1: You can open a new window by driver.execute_script("window.open('');") and then switch to it by driver.switch_to.window(driver.window_handles[1]) then you can drive

Should source code know it's being tested? [closed]

我的未来我决定 提交于 2019-12-25 05:28:26
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I have a complex codebase with tight couplings between functions and I am not able to write unit tests easily. Should source code know about testing environment, should it know it's being tested? To indicate it's being tested or so can be easily via global flag but I have a

Should source code know it's being tested? [closed]

筅森魡賤 提交于 2019-12-25 05:28:02
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I have a complex codebase with tight couplings between functions and I am not able to write unit tests easily. Should source code know about testing environment, should it know it's being tested? To indicate it's being tested or so can be easily via global flag but I have a

Geb select element that contains something

感情迁移 提交于 2019-12-25 05:16:13
问题 How do I select the value of a form select field when it has random numbers in its name? <select name="select_(random numbers)"> <option value="1"></option> </select> I have tried: formValidity {$("form").(contains('validity')) = "1 year"} which fails. 回答1: There are a few ways to achieve this: formValidity { $("form select[name*='validity']") } formValidity.value("1 year") You were trying to use the Geb way. Geb Selecting Manual You can also use CSS and jquery selectors which I used above

CasperJS doesn't evaluate jQuery method

别说谁变了你拦得住时间么 提交于 2019-12-25 04:48:12
问题 I injected jQuery to CasperJS: phantom.injectJs('./utils/jquery/jquery-2.1.4.js'); but when I try to evaluate some jQuery code, it is ignored: example: function dragNdropAlertToActivity() { var tt = casper.evaluate(function() { $('div[id^="scheduler-alert-grid"] table:contains(BLUE ALERT)')[0].simulate("drag-n-drop", { dragTarget: { dx: 71, dy: 71, interpolation: { stepCount: 2 } } }); return "done"; }); casper.echo(tt); }; calling method like: casper.test.begin(function(){...}) . test are

Casperjs and waitForUrl() to wait for next page

倾然丶 夕夏残阳落幕 提交于 2019-12-25 04:46:51
问题 I'd like to use the waitForUrl() function from http://docs.casperjs.org/en/latest/modules/casper.html#waitforurl . After a login form was send casperjs should wait for the next page is loaded. In the code below you see the "Second variant" that's the way I try to code this and you also see the occuring error message. The "First variant" is working so the dashboard.png is captured. Can someone explain what is wrong with the "Second variant"? // ... // Type and send login Form casper.then

SugarORM : While instrumentation testing, No such table Exception

爱⌒轻易说出口 提交于 2019-12-25 04:44:11
问题 This is my ApplicationTest.java package com.example.testing; import android.app.Application; import android.test.ApplicationTestCase; import com.example.agent.database.MyGroupsTable; import com.orm.SugarContext; import java.util.List; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { static final String DB_NAME = "database.db"; public ApplicationTest() { super(Application