Skip to content

Commit 263f081

Browse files
Add Table of Contents to API Docs (#5138)
1 parent 4ec155d commit 263f081

24 files changed

+275
-43
lines changed

docs/api/actions/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "Actions",
3-
"position": 20
3+
"position": 40
44
}

docs/api/commands/scrollintoview.mdx renamed to docs/api/actions/scrollintoview.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: scrollIntoView
3+
slug: /api/commands/scrollIntoView
34
---
45

56
Scroll an element into view.

docs/api/commands/scrollto.mdx renamed to docs/api/actions/scrollto.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: scrollTo
3+
slug: /api/commands/scrollTo
34
---
45

56
Scroll to a specific position.

docs/api/assertions/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "Assertions",
3-
"position": 10
3+
"position": 30
44
}

docs/api/commands/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "Other Commands",
3-
"position": 40
3+
"position": 50
44
}
File renamed without changes.

docs/api/cypress-api/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "Cypress API",
3-
"position": 70
3+
"position": 60
44
}

docs/api/events/catalog-of-events.mdx renamed to docs/api/cypress-api/catalog-of-events.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Catalog of Events
3+
sidebar_position: 10
34
---
45

56
Cypress emits a series of events as it runs in your browser.

docs/api/cypress-api/custom-commands.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Custom Commands
3+
sidebar_position: 20
34
---
45

56
Cypress comes with its own API for creating custom commands and overwriting

docs/api/cypress-api/custom-queries.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Custom Queries
3+
sidebar_position: 30
34
---
45

56
Starting in Cypress 12, Cypress comes with its own API for creating custom

docs/api/events/_category_.json

-4
This file was deleted.

docs/api/queries/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "Queries",
3-
"position": 30
3+
"position": 20
44
}

docs/api/queries/retriability-guide.mdx

-8
This file was deleted.

docs/api/table-of-contents.mdx

+237
Large diffs are not rendered by default.

docs/api/utilities/_category_.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "Utilities",
3-
"position": 60
3+
"position": 70
44
}

docs/faq/questions/using-cypress-faq.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ to either:
411411
- Prevent Cypress from failing the test
412412

413413
This is documented in detail on the
414-
[Catalog Of Events](/api/events/catalog-of-events) page and the recipe
414+
[Catalog Of Events](/api/cypress-api/catalog-of-events) page and the recipe
415415
[Handling errors](/examples/recipes#Fundamentals).
416416

417417
## <Icon name="angle-right" /> Will Cypress fail the test when an application has unhandled rejected promise?

docs/guides/core-concepts/interacting-with-elements.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ command directly BEFORE the action.
264264
Make sure your Developer Tools are open and you can get pretty close to "seeing"
265265
the calculations Cypress is performing.
266266

267-
You can also [bind to Events](/api/events/catalog-of-events) that Cypress fires
268-
as it's working with your element. Using a debugger with these events will give
269-
you a much lower level view into how Cypress works.
267+
You can also [bind to Events](/api/cypress-api/catalog-of-events) that Cypress
268+
fires as it's working with your element. Using a debugger with these events will
269+
give you a much lower level view into how Cypress works.
270270

271271
```js
272272
// break on a debugger before the action command

docs/guides/guides/debugging.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ by [Cypress Ambassador](https://www.cypress.io/ambassadors/) Josh Justice.
246246
## Log Cypress events
247247

248248
Cypress emits multiple events you can listen to as shown below.
249-
[Read more about logging events in the browser here](/api/events/catalog-of-events#Logging-All-Events).
249+
[Read more about logging events in the browser here](/api/cypress-api/catalog-of-events#Logging-All-Events).
250250

251251
<DocsImage
252252
src="/img/api/catalog-of-events/console-log-events-debug.png"

docs/guides/references/changelog.mdx

+12-10
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ _Released 02/2/2023_
259259

260260
- Fixed a regression introduced in Cypress [12.5.0](#12-5-0) where the
261261
`runnable` was not included in the
262-
[`test:after:run`](/api/events/catalog-of-events) event. Fixes
262+
[`test:after:run`](/api/cypress-api/catalog-of-events) event. Fixes
263263
[#25663](https://github.com/cypress-io/cypress/issues/25663).
264264

265265
**Dependency Updates:**
@@ -5638,7 +5638,7 @@ _Released 6/8/2020_
56385638
- utf-8 characters now properly display within error code frames. Fixes
56395639
[#7507](https://github.com/cypress-io/cypress/issues/7507).
56405640
- Errors thrown in a
5641-
[`cy.on('fail', fn)`](/api/events/catalog-of-events#Cypress-Events) fail
5641+
[`cy.on('fail', fn)`](/api/cypress-api/catalog-of-events#Cypress-Events) fail
56425642
handler now display a stack trace and code frame pointing to the origin of the
56435643
error. Fixes [#7512](https://github.com/cypress-io/cypress/issues/7512).
56445644
- [.click()](/api/commands/click) now properly clicks on wrapped inline elements
@@ -6584,7 +6584,8 @@ _Released 01/10/2020_
65846584
[#5625](https://github.com/cypress-io/cypress/issues/5625).
65856585
- We now capture GitLab CI's `CI_JOB_NAME` environment variable. Addressed in
65866586
[#6111](https://github.com/cypress-io/cypress/pull/6111).
6587-
- Types for [event emitters](/api/events/catalog-of-events#Binding-to-Events)
6587+
- Types for
6588+
[event emitters](/api/cypress-api/catalog-of-events#Binding-to-Events)
65886589
`removeListener` and `removeAllListeners` have been added to `Cypress` and
65896590
`cy`. Addresses [#5228](https://github.com/cypress-io/cypress/issues/5228).
65906591
- Types for the `runUrl` property returned from `cypress.run()` has been added.
@@ -6941,7 +6942,7 @@ _Released 10/31/2019_
69416942
[#5431](https://github.com/cypress-io/cypress/issues/5431).
69426943
- We fixed a bug where certain types of uncaught errors originating from the
69436944
application under test would not route through the
6944-
[uncaught:exception](/api/events/catalog-of-events#Uncaught-Exceptions)
6945+
[uncaught:exception](/api/cypress-api/catalog-of-events#Uncaught-Exceptions)
69456946
handler, and thus could not caught and ignored. These errors will also now
69466947
correctly indicate that they came from application code. Fixes
69476948
[#987](https://github.com/cypress-io/cypress/issues/987).
@@ -10070,7 +10071,7 @@ _Released 10/13/2017_
1007010071

1007110072
**Documentation Changes:**
1007210073

10073-
- [Added examples for "Catalog of Events"](/api/events/catalog-of-events)
10074+
- [Added examples for "Catalog of Events"](/api/cypress-api/catalog-of-events)
1007410075
- [Added](/ Updated FAQ for "Using Cypress"' using-cypress-faq)
1007510076

1007610077
## 1.0.1
@@ -10394,8 +10395,8 @@ _Released 09/10/2017_
1039410395
- We removed an artificial delay that was being set in between commands. This
1039510396
means test commands now run faster.
1039610397
- You can now
10397-
[disable Cypress global exception handlers](/api/events/catalog-of-events) for
10398-
your application. Fixes
10398+
[disable Cypress global exception handlers](/api/cypress-api/catalog-of-events)
10399+
for your application. Fixes
1039910400
[#254](https://github.com/cypress-io/cypress/issues/254)
1040010401
- Uncaught errors appearing in your spec files or support files are now properly
1040110402
caught, have the right exit code, and display correctly. Fixes
@@ -10420,10 +10421,11 @@ _Released 09/10/2017_
1042010421
automatic screenshot errors.
1042110422
- Using mocha's async `done` callback now works properly.
1042210423
- You can now programmatically
10423-
[intercept and potentially turn off uncaught application errors](/api/events/catalog-of-events)
10424+
[intercept and potentially turn off uncaught application errors](/api/cypress-api/catalog-of-events)
1042410425
from failing your tests.
1042510426
- You can now programmatically control whether you accept or cancel
10426-
[window.confirm()](/api/events/catalog-of-events) calls from your application.
10427+
[window.confirm()](/api/cypress-api/catalog-of-events) calls from your
10428+
application.
1042710429

1042810430
**Dependencies:**
1042910431

@@ -10626,7 +10628,7 @@ _Released 09/10/2017_
1062610628

1062710629
Note: we are still updating all of the docs to reflect all the 0.20.0 changes.
1062810630

10629-
- [New "Catalog of Events"](/api/events/catalog-of-events)
10631+
- [New "Catalog of Events"](/api/cypress-api/catalog-of-events)
1063010632
- [New "Cypress.Commands"](/api/cypress-api/custom-commands)
1063110633
- [New "Cypress.log"](/api/cypress-api/cypress-log)
1063210634
- [New ".trigger()"](/api/commands/trigger)

docs/guides/references/error-messages.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ currently running test.
10461046

10471047
You can turn off this behavior globally or conditionally with the
10481048
`uncaught:exception` event. Please see the
1049-
[Catalog of Events](/api/events/catalog-of-events#Uncaught-Exceptions) for
1049+
[Catalog of Events](/api/cypress-api/catalog-of-events#Uncaught-Exceptions) for
10501050
examples.
10511051

10521052
On a technical note, Cypress considers uncaught exceptions to be any error that

docusaurus.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const config = {
8787
activeBasePath: 'guides',
8888
},
8989
{
90-
to: '/api/commands/and',
90+
to: '/api/table-of-contents',
9191
label: 'API',
9292
position: 'left',
9393
activeBasePath: 'api',

netlify.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212
force = true
1313

1414
[[redirects]]
15-
from = "/api/table-of-contents/"
16-
to = "/api/commands/and"
15+
from = "/api/"
16+
to = "/api/table-of-contents/"
1717
status = 301
1818
force = true
1919

2020
[[redirects]]
21-
from = "/api/"
22-
to = "/api/commands/and"
21+
from = "/api/api/table-of-contents"
22+
to = "/api/table-of-contents/"
2323
status = 301
2424
force = true
2525

2626
[[redirects]]
27-
from = "/api/api/table-of-contents"
28-
to = "/api/table-of-contents/"
27+
from = "/api/events/catalog-of-events"
28+
to = "/api/cypress-api/catalog-of-events"
2929
status = 301
3030
force = true
3131

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"deploy": "docusaurus deploy",
1919
"clear": "docusaurus clear",
2020
"preserve": "npm run build:plugins",
21-
"serve": "docusaurus serve",
21+
"serve": "docusaurus serve --dir dist",
2222
"write-translations": "docusaurus write-translations",
2323
"write-heading-ids": "docusaurus write-heading-ids",
2424
"typecheck": "tsc",

src/theme/NotFound/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function NotFound() {
3737
<a href="/guides/core-concepts/introduction-to-cypress">Introduction to Cypress</a>
3838
</li>
3939
<li>
40-
<a href="/api/commands/and">The API Docs</a>
40+
<a href="/api">The API Docs</a>
4141
</li>
4242
<li>
4343
<a href="/examples/tutorials">Tutorials</a>

0 commit comments

Comments
 (0)