You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
So what happens if one of the requirements IS that duplicates aren't allowed (one record in the database actually maps to a single entity in the domain).Matt Phillips– Matt Phillips2012-11-06 14:21:47 +00:00Commented Nov 6, 2012 at 14:21
-
It's times like this when the internet sucks, because I can't actually show you what my tests look like. But if it helps I'm not really doing an integration test. I'm not looking at the database at all. I'm using selenium and specflow to actually manipulate my website in code.Matt Phillips– Matt Phillips2012-11-06 14:24:21 +00:00Commented Nov 6, 2012 at 14:24
-
@MattPhillips Your issue is two fold. Your requirements should not call out database records and common knowledge. If a user doesn't care/know about it then it shouldn't be a requirement. Secondly, Selenium is a great tool for testing the application UI and presentation logic, but this is no substitute for a true acceptance test. An acceptance test should not concern itself with duplicate database records, just that I can't create a user with the same ID. This kind of test is too low level for the UI to do well as you are experiencing. cont...maple_shaft– maple_shaft ♦2012-11-06 15:22:01 +00:00Commented Nov 6, 2012 at 15:22
-
... Try writing repeatable unit tests that use transactions for testing low level functionality and leave your Selenium tests for the more interesting tests involving UI interaction. Spring has really good support for transactional JUnit tests that automatically rollback. It is worth looking into.maple_shaft– maple_shaft ♦2012-11-06 15:24:00 +00:00Commented Nov 6, 2012 at 15:24
-
Ok, so your example "just that I can't create a user with the same ID" doesn't map to my domain though. My test shows that when you try and create something with duplicate data, an error message is shown in the UI, that to me would be the acceptance piece. But how do I structure it so I don't end up with 10's if not hundreds of fake data records just to use the UI properly. My application is very data driven. So i can't just fill the fields with garbage in order to test.Matt Phillips– Matt Phillips2012-11-06 15:27:02 +00:00Commented Nov 6, 2012 at 15:27
|
Show 3 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you