functional-testing

Duplicate the behaviour of a data driven test

时光总嘲笑我的痴心妄想 提交于 2020-01-04 15:31:14
问题 Right now, if you have a test that looks like this: [TestMethod] [DeploymentItem("DataSource.csv")] [DataSource( Microsoft.VisualStudio.TestTools.DataSource.CSV, "DataSource.csv", "DataSource#csv", DataAccessMethod.Sequential)] public void TestSomething() { string data = TestContext.DataRow["ColumnHeader"].ToString(); /* do something with the data */ } You'll get as many tests runs as you have data values when you execute this test. What I'd like to do is duplicate this kind of behaviour in

Duplicate the behaviour of a data driven test

狂风中的少年 提交于 2020-01-04 15:30:58
问题 Right now, if you have a test that looks like this: [TestMethod] [DeploymentItem("DataSource.csv")] [DataSource( Microsoft.VisualStudio.TestTools.DataSource.CSV, "DataSource.csv", "DataSource#csv", DataAccessMethod.Sequential)] public void TestSomething() { string data = TestContext.DataRow["ColumnHeader"].ToString(); /* do something with the data */ } You'll get as many tests runs as you have data values when you execute this test. What I'd like to do is duplicate this kind of behaviour in

How to test chat web app

北慕城南 提交于 2020-01-04 09:19:10
问题 I am developing chat application, using node.js socket.io module on a server, and javascript on a client. As it become more complex, I become tired to test different usage scenarios by clicking across browsers. At now I use different browsers in order to separate cookies. So in Firefox there is one chat participant, in Opera - second, etc. Therefore my question is: Can I automate this somehow? I've heard about headless testing engines like Phantom JS, Selenium WebDriver, but I don't know how

Appium Setup - no ./reset.sh file

我们两清 提交于 2020-01-04 06:22:24
问题 I am attempting to set up Appium and am following the tutorial. I get to the cd appium; ./reset.sh line in Install Ruby section. I don't have a reset.sh file anywhere. I've installed all prior steps, as well as XCode and Android Dev Studio . So I tried to skip over that step, and simply run appium with node . , which throws error: Error: Cannot find module '/Users/myname/Sites/myproject/appium Obviously it needs a server.js or app.js file, but the git clone git://github.com/appium/appium.git

Selenium Element Location

▼魔方 西西 提交于 2020-01-02 12:04:10
问题 Is there an easy way to find a child element from another element (both of these items have been located using a PageFactory)? We have a set of containers which hold many modules, and I'd like to ensure that they are displaying in their proper locations. The API only seems to have the following method: webElement.findElement(s).(By by); Is there an easy way to do the following: webElement.findElement(s)(WebElement webElement); or even better: webElement.contains(WebElement webElement); 回答1: I

JMockit + Jetty in functional tests

江枫思渺然 提交于 2020-01-02 04:32:29
问题 I'm using ShrinkWrap to start Jetty server in my integration tests. Problem: When I start my test jetty-server and than make mockup of my controller - mockup doesn't work! I suggest that the reason is different classloaders: JMockit - AppClassLoader, Jetty - WebAppClassLoader. Question: How to make mocking works fine? P.S. I've googled that -javaagent:jmockit.jar option may help. But it doesn't. Is it necessary for maven project based on 1.7 jdk? ADDITION: I've written demo to illustrate my

Symfony 3.3 service mocks for functional tests

时间秒杀一切 提交于 2020-01-01 08:52:25
问题 Before Symfony 3.3 it was allowed to set a mocked service onto the container. Now with 3.3 a deprecation warning is thrown because the service is already pre-defined. What is the new standard way to overwrite an existing or pre-defined service in the container to set a mocked service for a functional test? E.g. in our case we set a new entity manager with a new mocked connection pointing to a cloned database for testing. $container->set('doctrine.orm.entity_manager', $testEm); Setting the

Symfony 3.3 service mocks for functional tests

天大地大妈咪最大 提交于 2020-01-01 08:51:49
问题 Before Symfony 3.3 it was allowed to set a mocked service onto the container. Now with 3.3 a deprecation warning is thrown because the service is already pre-defined. What is the new standard way to overwrite an existing or pre-defined service in the container to set a mocked service for a functional test? E.g. in our case we set a new entity manager with a new mocked connection pointing to a cloned database for testing. $container->set('doctrine.orm.entity_manager', $testEm); Setting the

Symfony 2 controller test can't pass Authorization header

若如初见. 提交于 2019-12-31 22:37:29
问题 I have an HTTP API written in Symfony 2 and I'm writing some functional tests for it. I noticed that when I try to send an Authorization header it is not received in the controller when I log the received headers. In the test controller: $client = self::createClient(); $client->insulate(); $headers = array( 'Authorization' => "Bearer {$accessToken}", 'CONTENT_TYPE' => 'application/json', ); $client->request('DELETE', "/auth", array(), array(), $headers ); In the tested controller: print_r(

How to post JSON data in rails 3 functional test

给你一囗甜甜゛ 提交于 2019-12-31 12:53:34
问题 I plan to use JSON data in both request and response in my project and having some problems in testing. After searching for a while, I find the following code which uses curl to post JSON data: curl -H "Content-Type:application/json" -H "Accept:application/json" \ -d '{ "foo" : "bar" }' localhost:3000/api/new In the controller I can access the JSON data simply using params[:foo] which is really easy. But for functional testing, I only find post and xhr (alias for xml_http_request ). How can I