`
- **Description**: Finds the steps within a tutorial task.
#### `findStepsTitle()`
- **Returns**: `ElementWrapper`
- **Description**: Finds the title of the steps within a tutorial task.
#### `findTitle()`
- **Returns**: `ElementWrapper`
- **Description**: Finds the title of the tutorial task.
```
--------------------------------
### Render and Select Help Panel - React Testing Library
Source: https://cloudscape.design/components/help-panel/index.html
Demonstrates how to render the HelpPanel component and select it using Cloudscape's test utilities. It covers finding a single HelpPanel and finding all instances within a test environment.
```javascript
import { render } from '@testing-library/react';
import createWrapper from '@cloudscape-design/components/test-utils/dom';
import HelpPanel from '@cloudscape-design/components/help-panel';
describe('', () => {
it('renders the help-panel component', () => {
const { container } = render();
const wrapper = createWrapper(container);
expect(wrapper.findHelpPanel()).toBeTruthy();
});
it('selects all help-panel components', () => {
const { container } = render(<>
>);
const wrapper = createWrapper(container);
const components = wrapper.findAllHelpPanels();
expect(components).toHaveLength(3)
});
});
```
--------------------------------
### ExpandableSection - Expanding the expandable section
Source: https://cloudscape.design/components/expandable-section/index.html
This example demonstrates how to test the expansion of an ExpandableSection component. It clicks the expand button and verifies that the content is visible.
```APIDOC
## ExpandableSection - Expanding the expandable section
### Description
Tests the expansion functionality of the `ExpandableSection` component by clicking the expand button and asserting that the expandable content is visible.
### Method
`Test`
### Endpoint
`N/A` (Component Integration Test)
### Parameters
N/A
### Request Example
```javascript
import createWrapper from '@cloudscape-design/components/test-utils/selectors';
describe('ExpandableSection', () => {
it('expands the expandable section', async () => {
await browser.url('your-test-page');
const wrapper = createWrapper();
const expandButtonSelector = wrapper.findExpandableSection().findExpandButton().toSelector();
await browser.$(expandButtonSelector).click();
const expandableContentSelector = wrapper.findExpandableSection().findExpandedContent().toSelector();
const expandableContent = await browser.$(expandableContentSelector).getText();
expect(expandableContent).toBe('Expandable content');
});
});
```
### Response
#### Success Response (Test Assertion)
- `expect(expandableContent).toBe('Expandable content');` - Verifies the content of the expanded section.
#### Response Example
`N/A`
```
--------------------------------
### Install Board Components for Testing
Source: https://cloudscape.design/components/board/index.html
Imports necessary testing utilities for unit and integration testing of board components. Ensure the `@cloudscape-design/board-components` module is installed as a dependency.
```typescript
// side-effect import to install the finder methods
import '@cloudscape-design/board-components/test-utils/dom';
// use import from the main package to use the wrapper
import createWrapper from '@cloudscape-design/components/test-utils/dom';
createWrapper().findBoard().getElement();
```
```typescript
// side-effect import to install the finder methods
import '@cloudscape-design/board-components/test-utils/selectors';
// use import from the main package to use the wrapper
import createWrapper from '@cloudscape-design/components/test-utils/selectors';
createWrapper().findBoard().toSelector();
```
--------------------------------
### ExpandableSection - Collapsing the expandable section
Source: https://cloudscape.design/components/expandable-section/index.html
This example shows how to test the collapsing functionality of the ExpandableSection. It expands the section, then clicks the button again to collapse it, and verifies that the content is no longer visible.
```APIDOC
## ExpandableSection - Collapsing the expandable section
### Description
Tests the collapsing functionality of the `ExpandableSection` component. It first expands the section, then clicks the expand button again to collapse it, and asserts that the expandable content is no longer present.
### Method
`Test`
### Endpoint
`N/A` (Component Integration Test)
### Parameters
N/A
### Request Example
```javascript
import createWrapper from '@cloudscape-design/components/test-utils/selectors';
describe('ExpandableSection', () => {
it('collapses the expandable section', async () => {
await browser.url('your-test-page');
const wrapper = createWrapper();
const expandButtonSelector = wrapper.findExpandableSection().findExpandButton().toSelector();
await browser.$(expandButtonSelector).click(); // Expand
await browser.$(expandButtonSelector).click(); // Collapse
const expandableContent = wrapper.findExpandableSection().findExpandedContent().toSelector();
const isExpanded = await browser.$(expandableContent).isExisting();
expect(isExpanded).toBe(false);
});
});
```
### Response
#### Success Response (Test Assertion)
- `expect(isExpanded).toBe(false);` - Verifies that the expandable content element no longer exists.
#### Response Example
`N/A`
```
--------------------------------
### Steps Component ariaDescribedby Property Example
Source: https://cloudscape.design/components/steps/index.html
Illustrates how to provide a description for the Steps component using the `ariaDescribedby` property, linking it to an external paragraph for further context.
```javascript
import { Steps } from '@cloudscape/design-system-react';
// Assuming 'steps' is an array of step objects
const steps = [
// ... step definitions
];
function MyComponent() {
return (
<>
Cloudformation deployment will affect the following resources...
>
);
}
```
--------------------------------
### Integration Testing APIs - SupportPromptWrapper
Source: https://cloudscape.design/components/support-prompt-group/index.html
Information about the SupportPromptWrapper in the context of integration testing. No additional methods are available.
```APIDOC
## Integration Testing APIs - SupportPromptWrapper
### Description
Represents a support prompt item in integration testing scenarios.
### Methods
* No methods available. This wrapper does not provide any additional methods.
```
--------------------------------
### Render BreadcrumbGroup Component
Source: https://cloudscape.design/components/breadcrumb-group/index.html
Renders the BreadcrumbGroup component and verifies its presence using testing utilities. This example demonstrates basic rendering and is a prerequisite for more complex tests.
```javascript
import { render } from '@testing-library/react';
import createWrapper from '@cloudscape-design/components/test-utils/dom';
import BreadcrumbGroup from '@cloudscape-design/components/breadcrumb-group';
describe('', () => {
it('renders the breadcrumb-group component', () => {
const { container } = render();
const wrapper = createWrapper(container);
expect(wrapper.findBreadcrumbGroup()).toBeTruthy();
});
it('selects all breadcrumb-group components', () => {
const { container } = render(<> >
);
const wrapper = createWrapper(container);
const components = wrapper.findAllBreadcrumbGroups();
expect(components).toHaveLength(3)
});
});
```