testing

testing command line utilities

匆匆过客 提交于 2019-12-21 03:53:33
问题 I'm looking for a way to run tests on command-line utilities written in bash, or any other language. I'd like to find a testing framework that would have statements like setup: command = 'do_awesome_thing' filename = 'testfile' args = ['--with', 'extra_win', '--file', filename] run_command command args test_output_was_correct assert_output_was 'Creating awesome file "' + filename + '" with extra win.' test_file_contains_extra_win assert_file_contains filename 'extra win' Presumably the base

how to install unsigned android application on the device?

狂风中的少年 提交于 2019-12-21 03:50:48
问题 Currently a team of developers is working on Android application and during the development process testers already have to test the current state and report issues. So far I have simply installed the application by connecting the tester's device on my pc and hit run in the IDE. This way we waste a lot of time if an application has to be installed on multiple devices multiple times daily. What I would like is to send the testing team the .apk file and let them install and run the application

how to install unsigned android application on the device?

孤人 提交于 2019-12-21 03:50:22
问题 Currently a team of developers is working on Android application and during the development process testers already have to test the current state and report issues. So far I have simply installed the application by connecting the tester's device on my pc and hit run in the IDE. This way we waste a lot of time if an application has to be installed on multiple devices multiple times daily. What I would like is to send the testing team the .apk file and let them install and run the application

Adding rspec test for library module doesn't seem to pickup Expectations and Matchers

流过昼夜 提交于 2019-12-21 03:49:30
问题 I'm adding more rspec testing to my app and would like to test a ScoringMethods module, which is in /lib/scoring_methods.rb. So I added a /spec/lib directory and added scoring_methods_spec.rb there. I required spec_helper and set up the describe block as so: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ScoringMethods do describe "should have scorePublicContest method" do methods = ScoringMethods.instance_methods methods[0].should match(/scorePublicContest/)

Play! framework: customize which tests are run

这一生的挚爱 提交于 2019-12-21 03:38:18
问题 I have a Play! 2 for Scala application, and I am using Specs2 for tests. I can run all tests with the test command, or a particular specification with test-only MyParticularSpec . What I would like to do is mark some particular specifications, or even single methods inside a specification, in order to do things like: running all tests that are not integration (that is, that do not access external resources) running all tests that do not access external resources in write mode (but still

Can I override RESTClient default “HttpResponseException” response to >399 Return Codes?

人走茶凉 提交于 2019-12-21 03:37:50
问题 I'm using the Groovy RESTClient class to do write some (spock) Acceptance tests for Java WebServices I've been authoring. One frustration I've had is in testing the responses... 200 Status's are easy: when: def result = callServiceWithValidParams() then: result.status == 200 But with 400+ I'm forced to either wrap in a try-catch , or test for the HttpResponseException that RESTClient throws by default. when: callWithInvalidParams() then: def e = thrown(Exception) e.message == 'Bad Request'

Testing templates in Protractor?

老子叫甜甜 提交于 2019-12-21 03:36:27
问题 What's the best way to write assertions that should apply across every page in a site? I'm testing to see if an element exists in the footer of my site, so the element should exist on all pages. I am thinking of writing a separate file for testing template elements of the site, and then include this in all specs. It doesn't seem like anyone else is doing this though? 回答1: First of all, for writing cleaner tests and having a better understanding of what your target site consists of, apply the

Filtering sensitive data with VCR

倾然丶 夕夏残阳落幕 提交于 2019-12-21 03:29:10
问题 I'm using VCR gem to record http interactions and replay them in future. I want to filter-out my actual password value in the uri request. Here's sample of what the uri looks like: http://services.somesite.com/Services.asmx/Cabins Username=long&Password=john&StartDate=03%2F22%2F2012&EndDate=03%2F29%2F2012 Though an explanation is provided here, I'm still not sure how to do it after a few attempts myself: https://www.relishapp.com/myronmarston/vcr/v/2-0-0/docs/configuration/filter-sensitive

TypeError: environment.setup is not a function in React Testing

让人想犯罪 __ 提交于 2019-12-21 03:28:13
问题 I was trying to implement the example shown in Jest website: Getting started with Jest. While running npm test on I was getting the following error: FAIL src/sum.test.js ● Test suite failed to run TypeError: environment.setup is not a function at node_modules/jest-runner/build/run_test.js:112:23 sum.js : function sum(a, b){ return a+b; } module.exports = sum; sum.test.js : const sum = require('./sum'); test('adding sum function', () => { expect(sum(234,4)).toBe(238); }) sum.js and sum.test.js

How to load my test data in C#?

冷暖自知 提交于 2019-12-21 02:57:35
问题 I am struggling to find an easy way to load my test data in C#. In Java, I load a resource using the following code: ... public static InputStream loadResource(String resource) throws LoadException { InputStream is = TestUtils.class.getResourceAsStream(resource); if (is == null) { throw new LoadException("Error loading '" + resource + "'"); } return is; } ... public static void main(String[] args) { InputStream is = TestUtils.loadResource("/resourcelocation"); } I tried to use C# resource