Skip to content

Commit

Permalink
Merge pull request #10 from Lakitna/v0.1.0
Browse files Browse the repository at this point in the history
V0.1.0
  • Loading branch information
Lakitna committed Apr 10, 2019
2 parents 6af9dbd + da415c1 commit 01e2a27
Show file tree
Hide file tree
Showing 25 changed files with 889 additions and 648 deletions.
6 changes: 1 addition & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ assignees: ''
A clear and concise description of what the bug is.

# To Reproduce
Steps or code to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Steps or code to reproduce the behavior.

# Expected behavior
A clear and concise description of what you expected to happen.
Expand Down
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Documentation
about: Suggest improvements to the documentation
title: ''
labels: documentation
assignees: ''

---

# Changes should be made to

- [ ] General documentation (ex. README.md)
- [ ] Command documentation (ex. docs/then.md)
- [ ] Command type definitions / Intellisense

# Describe the improvement
Which file and which part should be changed?

# Why?
Why do you think there should be a change?

# Possible improvements
How can we improve it? You probably don't need to answer this question if you are writing the improvements yourself.

# Additional context
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ assignees: ''

---

# Type of feature

- [ ] Add a new command
- [ ] Extend a default Cypress command
- [ ] Change a Cypress-commands command
- [ ] Other

# What do you want to accomplish?
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Expand Down
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Closes #

- [ ] Tests
- [ ] Documentation
- [ ] Type definitions
- [ ] Ready for merge
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: node_js
node_js:
- "7"
- "8"
- "10"
script:
- npm run lint
- npm test
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

[![npm version](https://badge.fury.io/js/cypress-commands.svg)](https://badge.fury.io/js/cypress-commands)

A collection of high-quality Cypress commands to improve your life*.
A collection of high-quality Cypress commands to compliment and extend the defaults.

This repository is not maintained by the Cypress developers. This means we can choose to ignore certain parts of their vision. That being said, their vision is excellent and we should not deviate from it very much.

The goal of these commands is to give you better tools for specific situations and use cases.
This repository is not maintained by the Cypress developers. This means we can choose to ignore parts of their vision.

Documentation is a cornerstone of Cypress, the commands in this repository will try to keep these documentation standards.

\* These commands won't make your life better if you don't already know the powers and limitations of the default commands. It would only add clutter and you'll probably not be able to differentiate between all the options.

## Installation

Install the module.
Expand All @@ -26,17 +22,28 @@ Add the following line to `cypress/support/index.js`.
require('cypress-commands');
```

### Type definitions

Import typescript definitions by adding them to your `tsconfig.json`. Add the cypress-commands types before the Cypress types so intellisense will prefer the cypress-commands versions.

```json
"types": [
"cypress-commands",
"cypress"
]
```

## Extended commands

These commands have been extended to be able to more than originally intended. For these commands, all tests that exist in the Cypress repository are copied into this repository to make sure the default behaviour stays identical unless we want it changed.
These commands have been extended to be able to do more than originally intended. For these commands, all tests that exist in the Cypress repository are copied to make sure the default behaviour stays identical unless we want it changed.

* [`.then()`](./docs/then.md)

## Added commands

These commands do not exist in Cypress by default.

* None yet, though there are some coming.
* [`.text()`](./docs/text.md)

## Contributing

Expand Down
37 changes: 34 additions & 3 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,48 @@
<title>jQuery 3.2.1 Fixture</title>
<script type="text/javascript" src="lib/jquery-3.2.1.js"></script>
<script type="text/javascript" src="index.js"></script>
<style>
.indent {
padding-left: .4em;
margin: .3em 0 0 .1em;
border-left: 1px solid black;
}
</style>
</head>
<body>
<span id="foo">foo<span>
<span id="foo">foo</span>
<div>div</div>
<input />
<button>button</button>
<div class="counter">0</div>
<ul id="list">
</ul>
<a href="#">a</a>
<div>
Nested Find
<div class="whitespace">
div
containing&nbsp; &nbsp; &#x9; some<br> complex&Tab;whitespace
</div>
<hr>
<div class="parent indent">
parent div
<div class="child indent">
child div
<div class="grandchild indent">
grandchild div
<div class="great-grandchild indent">
great-grandchild div
<div class="great-great-grandchild indent">
great-great-grandchild div
</div>
</div>
</div>
</div>
<div class="secondchild indent">
secondchild div
<div class="secondgrandchild indent">
secondgrandchild div
</div>
</div>
</div>
</body>
</html>
6 changes: 6 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ setInterval(() => {
if (count < 5) {
$('#list').append('<li>li ' + count + '</li>');
}

const elem = $('.counter');
const val = +elem.text();
if (val < 5) {
elem.text(val + 1);
}
}, 100);
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"baseUrl": "http://localhost:1337/"
"baseUrl": "http://localhost:1337/",
"video": false
}
Loading

0 comments on commit 01e2a27

Please sign in to comment.