-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract StoragePage and Alert classes
- Loading branch information
Showing
4 changed files
with
47 additions
and
47 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
libs/ui-lib-tests/cypress/integration/storage/storage-step-disk-holders.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export class Alert { | ||
constructor(parentAlias: string, dataTestId?: string) { | ||
dataTestId | ||
? cy.get(parentAlias).findByTestId(dataTestId).as(Alert.name) | ||
: cy.get(parentAlias).find('.pf-c-alert').as(Alert.name); | ||
} | ||
|
||
static get alias() { | ||
return `@${Alert.name}`; | ||
} | ||
|
||
get body() { | ||
return cy.get(Alert.alias); | ||
} | ||
|
||
get title() { | ||
return this.body.find('.pf-c-alert__title'); | ||
} | ||
|
||
get description() { | ||
return this.body.find('.pf-c-alert__description'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Alert } from '../components/Alert'; | ||
|
||
export class StoragePage { | ||
constructor() { | ||
cy.get('.cluster-wizard').as(StoragePage.name); | ||
} | ||
|
||
static get alias() { | ||
return `@${StoragePage.name}`; | ||
} | ||
|
||
get body() { | ||
return cy.get(StoragePage.alias); | ||
} | ||
|
||
get diskLimitationAlert() { | ||
return new Alert(StoragePage.alias, 'diskLimitationsAlert'); | ||
} | ||
|
||
get diskFormattingAlert() { | ||
return new Alert(StoragePage.alias, 'alert-format-bootable-disks'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters