integration-testing

NUnit3 multiple App.config files in Teamcity

时间秒杀一切 提交于 2019-12-11 14:24:05
问题 I'm having a strange problem. I have a bunch of integration tests projects. Each test project has a configuration file (app.config). Currently, in my "Run Integration Tests" build step, the NUnit3 console runner allows me to specify only one config file (where it says "Path to application configuration file"). I have specified the path to one of my integration test app.configs. The problem is, the tests in other test projects fail because the Nunit3 console doesn't recognize their app.config

How to assert in selenium test case for login success?

不问归期 提交于 2019-12-11 13:55:29
问题 i made a success selenium test case for login page , which a user enters a correct username and password and then hit login to forwarded to home page, issue is that when i change the password in the test class, the test always success i don't know why. here's the test Class: public class LoginTest extends TestCase { private WebDriver driver; private String baseUrl; private StringBuffer verificationErrors = new StringBuffer(); @Before public void setUp() throws Exception { driver = new

In-Container testing with JUnit

╄→гoц情女王★ 提交于 2019-12-11 12:47:10
问题 I am new to JUnit and trying to implement it in a legacy project. It is a Java EE project. Its UI layer is in Flex and the backend has Hibernate as the ORM layer with a SQL Server Database. It runs on Tomcat. I am taking baby steps to learn JUnit myself and implement it into the codebase. There is a class which has its findByFK method. This method returns an array of class objects if any are found. The method runs fine on a web application but I can't run its JUnit test case. The test case is

Integration testing using Selenium and NUnit - From UI to DB

隐身守侯 提交于 2019-12-11 11:35:10
问题 I am having some problems while trying to create integration tests with Selenium and NUnit. I'm trying to use Selenium RC in NUnit test to drive my ASP.NET web app, and would like the tests to actually do all the stuff in DB that the real user would do. Naturally it would be nice if the database could get rolled back after Selenium has done it's thing, and i've asserted that db contains the new rows (etc) with the data from the ui. So, here's the setup i have (in some sort of pseudocode):

Testing a spring controller method having @ModelAttribute as parameter

假如想象 提交于 2019-12-11 10:23:10
问题 I am trying to test a controller with this method: @RequestMapping(value="/test") public ModelAndView generateRecords(@ModelAttribute("Employee") Employee employee) { And I would like to know how can I create a unit testing for testing this. At the moment I am using: MockHttpServletRequest request = new MockHttpServletRequest(); request.setRequestURI("/test"); //request.setMethod("GET"); new AnnotationMethodHandlerAdapter().handle(request, new MockHttpServletResponse(), this.controller);

Testing date values with HSQLDB

三世轮回 提交于 2019-12-11 10:11:36
问题 We use SQLServer in production, but HSQLDB for our integration tests. HSQLDB is used because it's an in-memory database. I have an SQLServer SQL that executes the following code: select convert(varchar(8), pos_val_date, 112) from wscpos; In HSQLDB, this does not work. The code should be: select to_char( pos_val_date, 'YYYYMMDD') from wscpos; What's the best practice to adapt my code such that it runs both in production and in my integration test? 回答1: If you are inclined to change your DB for

Arquillian tests stop working after enabling Websphere security

杀马特。学长 韩版系。学妹 提交于 2019-12-11 09:55:36
问题 Arquillian IT tests run fine till the moment I enabled the security in Websphere admin console (In order to build the login functionality). So the question is how to run Tests with Websphere security anabled. Its LDAP (Microsoft AD). Thanks Arquillian.xml ...... <container qualifier="websphere" default="true"> <configuration> <property name="remoteServerAddress">localhost</property> <property name="remoteServerSoapPort">8880</property> <property name="securityEnabled">true</property> <

Do atomic tests make sense in dynamically created environments?

ぐ巨炮叔叔 提交于 2019-12-11 09:45:02
问题 We´re building a product that allows users to create custom databases and store data within those DBs (WebApp). Our issue for testing of the frontend (coffeescript) is that every test should be atomic but that would require setting up a DB for seeing if an item within that DB can be created and persists or to see how changes in a DB affect items. Essentially, the issue is that the setup code needed to get to the item tests basically sets up a new DB and therefore equals the code that tests

Espresso idling resource not working if long running task is started in Activity's onCreate?

人盡茶涼 提交于 2019-12-11 08:57:06
问题 How to use espresso idling resource if long running task is started in Activity's onCreate ? I have created a custom IdlingResource and it is working fine if the long async method call is triggered by click event, but breaks whenever the it is called in Acitivty's onCreate method. Example: public void onBtnClick(){ setIdle(true); // This works fine, our tests wait until setIdle(false) is called doSomeBackgroundTask(); } public void onDone(){ setResourceIdle(false); setIdle(false); } @Override

Can I use FlurlClient with Asp.Net Core TestServer?

Deadly 提交于 2019-12-11 08:48:38
问题 We are using FlurlClient in a few projects and familiar with their fluent interface. We now want to use it in asp.net core integration tests using TestServer. The example from http://asp.net-hacker.rocks/2017/09/27/testing-aspnetcore.html _server = new TestServer(new WebHostBuilder() .UseStartup<Startup>()); _client = _server.CreateClient(); I was going to change code to _server = new TestServer(new WebHostBuilder() .UseStartup<Startup>()); var httpClient = _server.CreateClient(); _client =