testing

How to restore database before executing test in protractor

元气小坏坏 提交于 2020-01-04 02:48:08
问题 I have written E2E tests in Protractor which uses node to run through webdriver. Now I have some inserts tests which will insert the data and create user. Now if I run the case for the first time it will pass but when I will rerun the test it will fail as it will already present. Expected : I need to restore my MSSQL DB when ever the tests in protractor start. Present : I am doing manually by restoring the test. Is there any way that I can restore the DB through protractor or Node ? 回答1: This

Is it possible to configure cucumber to run the same test with different spring profiles?

拟墨画扇 提交于 2020-01-04 02:32:07
问题 I have an application where I'm running a trial with different technologies. I have a set of interfaces implemented with each technology and I use spring profiles to decide which technology to run. Each of the technologies has its own Spring java config annotated with the profile they are active for. I run my cucumber tests defining which profile is the active one but this forces me to manually change the string every time I want to test a different profile, making it impossible to run

How to get text in png file using Java

别等时光非礼了梦想. 提交于 2020-01-04 02:17:07
问题 I want to check if particular string is present in the image. Is that possible? Is pngj can do that? My file will contain a graph and some legends. I want to check the if the legends are correct. 回答1: No, you can't do that with pngj. The text that is visible in the PNG image is not internally stored as text. You will need OCR software if you wish to identify the text. However it would be much better if you could get the data in another format that is easier to parse by a computer. 回答2: Yes,

Selenium View Mouse/Pointer

帅比萌擦擦* 提交于 2020-01-04 01:56:07
问题 Is there any way to actually see the selenium mouse when it's running the tests? Either with a windows cursor image or some kind of dot or cross hair or anything at all! I'm trying to get a drag and drop function working with selenium and java in an HTML5 web app, and being able to see the cursor to see what it's actually doing would be really useful... 回答1: In the end I had to use the Java robot to get this working. Not only to see the mouse, but also because for an HTML5 Web App dragging

Integration testing - seeking your knowledge, advice and links!

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-04 01:52:06
问题 Hey guys, I'm after some advice and pointers on integration testing for a web app. Our project has been running for a number of years and it's reasonably complex. We're pretty well covered with unit tests but we're missing a decent set of integration tests. We don't have documented use cases or even a reasonable set of test cases beyond our unit tests. 'Integration testing' today consists of the developer's knowledge of the likely impact of a change and manual, ad-hoc testing of the app. It's

Mockito test not seen by Maven?

我与影子孤独终老i 提交于 2020-01-04 01:22:29
问题 I'm building my package with maven (runs without problems) and then I try to make a Mockito test for a class. Dependencies in the pom.xml are as follows: <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-project</artifactId> <version>2.0.6</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>1.9.5</version> <scope>test</scope> </dependency> </dependencies> </project> The mockito

Mockito test not seen by Maven?

爱⌒轻易说出口 提交于 2020-01-04 01:21:18
问题 I'm building my package with maven (runs without problems) and then I try to make a Mockito test for a class. Dependencies in the pom.xml are as follows: <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-project</artifactId> <version>2.0.6</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>1.9.5</version> <scope>test</scope> </dependency> </dependencies> </project> The mockito

How to test IP address geolocation service

荒凉一梦 提交于 2020-01-03 19:35:32
问题 There is a IP address geolocation service that will tell the viewer city or country based on IP address. and we might set the default country on menu based on the result of this location service. I wonder how can i test on this such as i am in Thailand but want to test it by stimulating Hongkong ip address so that i can see if that website provide proper feedback based on geolocation service. 回答1: Try using a socks proxy http://sockslist.net/. 回答2: They way we're validating IP geolocations

How can a gem provide Cucumber features and step definitions?

◇◆丶佛笑我妖孽 提交于 2020-01-03 18:33:24
问题 I have two Rails projects (A and B) with the following gems, among others: #project A gem "green_theme", :path => "~/dev/themes/green_theme" gem "devel_tasks", :path => "~/dev/themes/devel_tasks" #project B gem "red_theme", :path => "~/dev/themes/red_theme" gem "devel_tasks", :path => "~/dev/themes/devel_tasks" Both projects, A and B, have a features dir for features and steps. Both themes, red and green, should have common functionalities like login/logout buttons, html meta-tags, and so on.

How can a gem provide Cucumber features and step definitions?

♀尐吖头ヾ 提交于 2020-01-03 18:33:12
问题 I have two Rails projects (A and B) with the following gems, among others: #project A gem "green_theme", :path => "~/dev/themes/green_theme" gem "devel_tasks", :path => "~/dev/themes/devel_tasks" #project B gem "red_theme", :path => "~/dev/themes/red_theme" gem "devel_tasks", :path => "~/dev/themes/devel_tasks" Both projects, A and B, have a features dir for features and steps. Both themes, red and green, should have common functionalities like login/logout buttons, html meta-tags, and so on.