integration-testing

Mock/Test Mongodb Database Node.js

别等时光非礼了梦想. 提交于 2019-12-03 01:15:44
I am learning nodejs and I have a mongodb database with which i have to interact with. I am currently thinking of using mocha for a unit test framework and zombie.js for a acceptance test framework. I was wondering how could I do full scale acceptance tests which hit the mongodb database. Is there a framework/module that helps with replacing the database with a test database or does either mocha or zombie.js have functionality that can easily be used to replace the database. Also is there a framework that is similar to the idea of factories (instead of fixtures) in creating database objects. A

Testing Snackbar show with Espresso

爱⌒轻易说出口 提交于 2019-12-03 01:04:46
Is there a way to test using Espresso that the snackbar shows up with the right text? I have a simple call to create a snackbar Snackbar.make(mView, "My text", Snackbar.LENGTH_LONG).show(); I have tried this without luck onView(withText("My text")).inRoot(withDecorView(not(is(mActivityRule.getActivity().getWindow().getDecorView())))).check(matches(isDisplayed())); ksarmalkar This worked for me, please try. onView(allOf(withId(android.support.design.R.id.snackbar_text), withText("My text"))) .check(matches(isDisplayed())); If you use AndroidX, please use the following: onView(withId(com.google

What best practices do you use for testing database queries?

旧城冷巷雨未停 提交于 2019-12-03 00:19:07
I'm currently in the process of testing our solution that has the whole "gamut" of layers: UI, Middle, and the omnipresent Database. Before my arrival on my current team, query testing was done by the testers manually crafting queries that would theoretically return a result set that the stored procedure should return based on various relevancy rules, sorting, what have you. This had the side effect of bugs being filed against the tester's query more often than against the actual query in question. I proposed actually working with a known result set that you could just infer how it should

Performance testing best practices when doing TDD?

北战南征 提交于 2019-12-03 00:02:43
I'm working on a project which is in serious need of some performance tuning. How do I write a test that fails if my optimizations do not in improve the speed of the program? To elaborate a bit: The problem is not discovering which parts to optimize. I can use various profiling and benchmarking tools for that. The problem is using automated tests to document that a specific optimization did indeed have the intended effect. It would also be highly desirable if I could use the test suite to discover possible performance regressions later on. I suppose I could just run my profiling tools to get

Protractor E2E Test Seed Database

烂漫一生 提交于 2019-12-02 23:53:04
I haven't found a good way of doing this so hoping someone has some ideas. Is there any way to seed the database with test data before running a E2E Protractor test? Do people do this or do they just mock out the back end? Mocking out the back end for me is not an option so would appreciate ideas on how to seed the database. There are a few solutions out there using node but nothing conclusive. The whole point of E2E testing for my case would be to go to the DB level Thanks Delian Mitankin Being in a NodeJs environment, you can connect to the database directly from Protractor, but I wouldn't

How to integrate Sikuli scripts into Selenium?

偶尔善良 提交于 2019-12-02 22:51:58
I'm extensively using Selenium for integration testing. Works great for all normal stuff (HTML/AJAX), but no go when I'm trying to test third party ActiveX, Java applets and Flash components. The solution I've found for this is Sikuli . Works great locally, but how can I integrate that into Selenium? btw. if that's relevant, for Selenium I'm using Python API. See the Python section of the Selenium RC documentation: http://seleniumhq.org/docs/05_selenium_rc.html#python You may be able to run Selenium tests from Jython. In that case, you can simply integrate Selenium scripts into your Sikuli

How to perform integration testing in PHP?

拜拜、爱过 提交于 2019-12-02 22:15:01
I am currently performing unit tests on my code (using PHPUnit and Jenkins) but I have read a lot about integration testing. Are there any tools to perform this in php (preferably automated)? How would I go about implementing it? Are there any good tutorials anywhere? Basically the way to go is to implement besides unit tests also mock tests which are not solely testing a single unit more like a group of units bunched together and you see them as a logical unit which should behave in a certain way while handing in some input or calling methods. One possible library for this is yaymock in the

Simulating the passing of time in unittesting

家住魔仙堡 提交于 2019-12-02 21:35:16
I've built a paywalled CMS + invoicing system for a client and I need to get more stringent with my testing. I keep all my data in a Django ORM and have a bunch of Celery tasks that run at different intervals that makes sure that new invoices and invoice reminders get sent and cuts of access when users don't pay their invoices. For example I'd like to be a able to run a test that: Creates a new user and generates an invoice for X days of access to the site Simulates the passing of X + 1 days, and runs all the tasks I've got set up in Celery. Checks that a new invoice for an other X days has

How to automate integration testing?

徘徊边缘 提交于 2019-12-02 20:28:50
I'd like to know something, I know that to make your test easier you should use mock during unit testing to only test the component you want, without external dependencies. But at some point, you have to bite the bullet and test classes which interact with your database, files, network, etc. My main question is: what do you do to test these classes? I don't feel that installing a database on my CI server is a good practice, but do you have other options? Should I create another server with other CI tools, with all externals dependencies? Should I run integration test on my CI as often as my

Exactly what is integration testing - compared with unit

淺唱寂寞╮ 提交于 2019-12-02 20:14:10
I am starting to use unit testing in my projects, and am writing tests that are testing at the method/function level. I understand this and it makes sense. But, what is integration testing? From what i read it moves the scope of testing up to test larger features of an application. This implies that I write a new test suite to test larger things such as (on an e-commerce site) checkout functionality, user login functionality, basket functionality. So here i would have 3 integration tests written? Is this correct - if not can someone explain what is meant. Also, does integration test involve