testing

Cyclomatic complexity and basis path

最后都变了- 提交于 2020-02-06 04:28:24
问题 Lets, consider we have the following method: public void testIt(boolean a, boolean b){ if (a && b){ ... } if (a){ .... } } Cyclomatic complexity of this method =3. So, according to basis path testing we should have 3 tests in order to achieve statement and decision coverage. However, I see that I can use only two tests (true, true) and (false,false) to achieve statement and decision coverage. Where is my mistake? 回答1: answer from @OldFox is correct, just some additions: Where is my mistake?

Robotium Assertion Failing

百般思念 提交于 2020-02-05 09:03:13
问题 When I run a test with Robotium, I use an assertion to verify that there is specific text on the page, but it fails. However, when I run the test without the assertion, the test passes. Why would this be? Here is my code: import com.jayway.android.robotium.solo.Solo; import android.test.ActivityInstrumentationTestCase2; import android.test.suitebuilder.annotation.Smoke; @SuppressWarnings("unchecked") public class ODPRobotiumTest extends ActivityInstrumentationTestCase2 { private static final

How to write a Redux Saga Test by mocking selectors and / or redux store

女生的网名这么多〃 提交于 2020-02-05 04:08:05
问题 Context: I'm brand new to writing Redux Saga tests and have been using the React Boilerplate to develop an app, which uses Jest for testing. The boilerplate is extremely modular and complex and I am having trouble figuring out how to even begin writing a test to mock selectors and state for my Saga to use within the test. In the Saga, I'm using Reselect (within the './selectors' file) to grab the 'Username' and "Password' from the reducer, assign them to a constant using yield select , and

How to share a global variable between test files from a test in TestCafe?

余生颓废 提交于 2020-02-04 06:36:54
问题 I'm manually setting auth cookies for my login purpose and I would like to share the Auth token across my tests. The very first time I have to perform a login in a test and then I have to save the auth token in a variable and share it across the test files. Here is the code snippet to explain what and how I'm trying to do: loginTest.js : let authToken = null; fixture`Login test` .page(inputData.url) .beforeEach(async (t) => { const nextMonth = new Date(); nextMonth.setMonth(nextMonth.getMonth

Is there any way to change the Celery config programmatically, after app init?

好久不见. 提交于 2020-02-04 06:23:42
问题 I have set up a testing environment where I have Celery workers actually running in other processes, so that the full functionality of my system with Celery can be tested. This way, tasks actually run in a worker process and communicate back to the test runner, and so I don't need CELERY_ALWAYS_EAGER to test this functionality. That being said, in some situations I have tasks which trigger off other tasks without caring when they finish, and I'd like to create tests which do - that is, to

Is there any way to change the Celery config programmatically, after app init?

梦想与她 提交于 2020-02-04 06:22:49
问题 I have set up a testing environment where I have Celery workers actually running in other processes, so that the full functionality of my system with Celery can be tested. This way, tasks actually run in a worker process and communicate back to the test runner, and so I don't need CELERY_ALWAYS_EAGER to test this functionality. That being said, in some situations I have tasks which trigger off other tasks without caring when they finish, and I'd like to create tests which do - that is, to

The specified glob pattern does not match any file or the default test directories are empty. - testcafe

亡梦爱人 提交于 2020-02-03 13:03:33
问题 I have started learning testcafe, as our organization wanted to invest time on R & D on getting new e2e tools for angular automation. I am trying to create an initial small test and facing the following error. I have installed the testcafe locally using the command npm install --save-dev testcafe and have created a spec file with name first-test.spec.ts import { Selector } from "testcafe"; fixture`Getting Started`.page`http://devexpress.github.io/testcafe/example`; test("My First Test", async

EarlGrey - How do I check if multiple objects are being shown on the screen

无人久伴 提交于 2020-02-03 10:42:47
问题 The EarlGrey documentation says that You must narrow down the selection until it can uniquely identify a single UI element I have three UIViews on my UI that I need to check the visibility of using the grey_sufficientlyVisible() assertion. However, unless if I literally pick each one up using their individual accessibility labels or so, I cannot match all of them. Is there a way to match a super-set of views or should I create individual test conditions for each of the views? 回答1: By saying

EarlGrey - How do I check if multiple objects are being shown on the screen

Deadly 提交于 2020-02-03 10:42:22
问题 The EarlGrey documentation says that You must narrow down the selection until it can uniquely identify a single UI element I have three UIViews on my UI that I need to check the visibility of using the grey_sufficientlyVisible() assertion. However, unless if I literally pick each one up using their individual accessibility labels or so, I cannot match all of them. Is there a way to match a super-set of views or should I create individual test conditions for each of the views? 回答1: By saying

How to login in Auth0 in an E2E test with Cypress?

邮差的信 提交于 2020-02-03 03:46:26
问题 I have started testing a react webapp but I didn't go far because I had issues with the login. I am using cypress e2e testing tool. A welcome page is shown with a button to login, which will redirect you to auth0 service. User is login with email and password , then is redirected back to the webapp with a token. I tried many different approach each of them resulting in a different problem. Note: I don't want to test Auth0, I just want to enter in my webapp. Attempt 1. Clicking on login button