integration-testing

Integration testing an MVC application without the pain of UI automation

喜你入骨 提交于 2019-12-05 02:26:03
问题 I'm starting development on a new MVC application that will be largely written using TDD. I'd like to add some integration tests to ensure that the fully wired application (I'm using StructureMap for IOC, NHibernate for persistence) works as expected. While I intend to write a few functional smoke tests with Selenium, for maintainability reasons, I'd rather do my most of integration testing by directly calling actions on my controllers using good old C#. There is surprisingly little guidance

IntegrationTests - A potentially dangerous Request.Path value was detected from the client

谁都会走 提交于 2019-12-05 02:18:04
问题 I get this error: A potentially dangerous Request.Path value was detected from the client (?). when this URI: http://www.site.com/%3f . How can I write an integration tests around of all of this type of errors? I want to test against all this erros: A potentially dangerous Request.Path value was detected from the client A potentially dangerous Request.Cookies value was detected from the client A potentially dangerous Request.Form value was detected from the client A potentially dangerous

Rails rspec and omniauth (integration testing)

余生颓废 提交于 2019-12-05 02:01:49
My Rails 3.2 app uses OmniAuth and Devise to sign in with Twitter. The authentication system works fine. I would like to write an integration test in rspec to make sure everything works. Using the information in the wiki, I've written the following, but I know I'm missing things. Under test.rb in config/environments, I have the following lines OmniAuth.config.test_mode = true OmniAuth.config.mock_auth[:twitter] = {:provider => 'twitter', :uid => '123545'} My rspec test looks like this: describe "Authentications" do context "without signing into app" do it "twitter sign in button should lead to

What's the proper way to test token-based auth using APIRequestFactory?

為{幸葍}努か 提交于 2019-12-05 01:56:58
The query to my endpoint works fine (as long as I pass it a valid token), it returns the json representation of my response data. The code in the service api that calls my endpoint, passing an auth token in the header: headers = {'content-type': 'application/json', 'Authorization': 'Token {}'.format(myToken)} url = 'http://localhost:8000/my_endpoint/' r = session.get(url=url, params=params, headers=headers) In views.py, I have a method decorator that wraps the dispatch method on the view (viewsets.ReadOnlyModelViewSet): def login_required(f): def check_login_and_call(request, *args, **kwargs):

Ember Component Integration Tests: `link-to` href empty

风流意气都作罢 提交于 2019-12-05 01:37:06
I'm trying to write a component integration test, a la this blog post , but my component has a link-to to a dynamic route and the href property isn't being filled in. Here is a simplified version of what I'm trying to do. My component's template: {{#link-to "myModel" model}} And here is the relevant part of my test: this.set('model', { id: 'myId', name: 'My Name' }); this.render(hbs` {{my-component model=model}} `); assert.equal(this.$('a').attr('href'), '/myModel/myId'); // fails The link-to is rendered, just without an href attribute. If I log the HTML in the test, it looks like: <a id=

Supermarket dataset for Apriori algorithm

白昼怎懂夜的黑 提交于 2019-12-05 01:30:52
问题 'I have to develop a software which is meant for Business Analyst of “Future Stores” Supermarket, the software performs the Association Rule Mining on given transitional data of supermarket sales transactions and prepares Discounting policy by preparing Combo. The software makes use of the data mining algorithms namely Apriori Algorithm. The Association Rules will be displayed in User friendly manner for generation of discounting policy based on positive association rules.' From where can I

Set Nunit TimeoutAttribute from SpecFlow

谁说我不能喝 提交于 2019-12-05 01:30:18
问题 I've written several long running end to end integration tests using SpecFlow, but they are failing due to Nunit timeouts. Adding the [Timeout(x)] attribute to the TestFixture solves the issue, but of course gets overwritten everytime the feature is updated. How can I remove or extend the timeout in a way that SpecFlow will respect? 回答1: I am only getting to understand Specflow but could you implement a custom tag that could do this? Maybe you could place these at the BeforeScenario or

I want to test a private method - is there something wrong with my design? [duplicate]

二次信任 提交于 2019-12-05 01:06:15
This question already has answers here : How do I test a private function or a class that has private methods, fields or inner classes? (51 answers) Closed last year . So I'm extremely new to software testing, and am looking at adding a couple of tests to one of my applications. I have a public method addKeywords() which along the way calls a private method removeInvalidOperations(). This private method makes calls to an external API and is ~50 lines of code. As I consider this to be a somewhat complex method I would like to test this without having to do so through calling the addKeyword()

Using Specflow scenarios for both intergration tests and unit tests

别等时光非礼了梦想. 提交于 2019-12-05 00:39:10
问题 I've just come across BBD and specflow and it looks very interesting. When writing user stories they are typically on a high-level and the actor users the GUI. So when writing scenarios they will typically be GUI test or integration test from a high level of the system. But what about unit test further down in the solution? E.g. service endpoints, business objects, etc. Should I write new scenarios for those or is there a way to reuse the same scenarios for low level testing (unit tests) or

Elasticsearch Spring boot integration test

笑着哭i 提交于 2019-12-04 23:44:47
I am looking for the way to add embedded elasticsearch to my spring boot integration test. I looked at elastic search integration test but it does not work together with spring boot as both should uses different test runner. I have a class test as below unfortunately it does not work with error: java.lang.IllegalStateException: No context information for thread: Thread[id=1, name=main, state=RUNNABLE, group=main]. Is this thread running under a class com.carrotsearch.randomizedtesting.RandomizedRunner runner context? Add @RunWith(class com.carrotsearch.randomizedtesting.RandomizedRunner.class)