-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [M3-8103] - Refactor Image Create and Add Tags (#10471)
* initial work * add helper text * make the restricted user experience better * fixes and clean up * fix type errors * add missing placeholder text * improve e2e testing for image creation * add changesets * improve api-v4 docs --------- Co-authored-by: Banks Nussman <banks@nussman.us>
- Loading branch information
1 parent
7b89452
commit 4b4a3da
Showing
17 changed files
with
541 additions
and
439 deletions.
There are no files selected for viewing
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
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,5 @@ | ||
--- | ||
"@linode/manager": Added | ||
--- | ||
|
||
Tags to Image create capture tab ([#10471](https://github.com/linode/manager/pull/10471)) |
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,5 @@ | ||
--- | ||
"@linode/manager": Tests | ||
--- | ||
|
||
Clean up and improves image creation Cypress tests ([#10471](https://github.com/linode/manager/pull/10471)) |
87 changes: 87 additions & 0 deletions
87
packages/manager/cypress/e2e/core/images/create-image.spec.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import type { Linode } from '@linode/api-v4'; | ||
import { authenticate } from 'support/api/authentication'; | ||
import { ui } from 'support/ui'; | ||
import { cleanUp } from 'support/util/cleanup'; | ||
import { createTestLinode } from 'support/util/linodes'; | ||
import { randomLabel, randomPhrase } from 'support/util/random'; | ||
|
||
authenticate(); | ||
describe('create image (e2e)', () => { | ||
before(() => { | ||
cleanUp(['linodes', 'images']); | ||
}); | ||
|
||
it('create image from a linode', () => { | ||
const label = randomLabel(); | ||
const description = randomPhrase(); | ||
|
||
// When Alpine 3.19 becomes deprecated, we will have to update these values for the test to pass. | ||
const image = 'linode/alpine3.19'; | ||
const disk = 'Alpine 3.19 Disk'; | ||
|
||
cy.defer( | ||
createTestLinode({ image }, { waitForDisks: true }), | ||
'create linode' | ||
).then((linode: Linode) => { | ||
cy.visitWithLogin('/images/create'); | ||
|
||
// Find the Linode select and open it | ||
cy.findByLabelText('Linode') | ||
.should('be.visible') | ||
.should('be.enabled') | ||
.should('have.attr', 'placeholder', 'Select a Linode') | ||
.click() | ||
.type(linode.label); | ||
|
||
// Select the Linode | ||
ui.autocompletePopper | ||
.findByTitle(linode.label) | ||
.should('be.visible') | ||
.should('be.enabled') | ||
.click(); | ||
|
||
// Find the Disk select and open it | ||
cy.findByLabelText('Disk') | ||
.should('be.visible') | ||
.should('be.enabled') | ||
.click(); | ||
|
||
// Select the Linode disk | ||
ui.autocompletePopper.findByTitle(disk).should('be.visible').click(); | ||
|
||
// Give the Image a label | ||
cy.findByLabelText('Label') | ||
.should('be.enabled') | ||
.should('be.visible') | ||
.type(label); | ||
|
||
// Give the Image a description | ||
cy.findByLabelText('Description') | ||
.should('be.enabled') | ||
.should('be.visible') | ||
.type(description); | ||
|
||
// Submit the image create form | ||
ui.button | ||
.findByTitle('Create Image') | ||
.should('be.enabled') | ||
.should('have.attr', 'type', 'submit') | ||
.click(); | ||
|
||
ui.toast.assertMessage('Image scheduled for creation.'); | ||
|
||
// Verify we redirect to the images landing page upon successful creation | ||
cy.url().should('endWith', 'images'); | ||
|
||
// Verify the newly created image shows on the Images landing page | ||
cy.findByText(label) | ||
.closest('tr') | ||
.within(() => { | ||
// Verify Image label shows | ||
cy.findByText(label).should('be.visible'); | ||
// Verify Image has status of "Creating" | ||
cy.findByText('Creating', { exact: false }).should('be.visible'); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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
Oops, something went wrong.