-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: [M3-8526] - Update remaining Linode Create Cypress tests run ag…
…ainst Linode Create v2 (#10889) * run tests aginst linode create v2 * Added changeset: Update remaining Linode Create Cypress tests run against Linode Create v2 * extract into new test files * retain the linode create region select test --------- Co-authored-by: Banks Nussman <banks@nussman.us>
- Loading branch information
1 parent
9e2a990
commit 4379494
Showing
19 changed files
with
497 additions
and
832 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Tests | ||
--- | ||
|
||
Update remaining Linode Create Cypress tests run against Linode Create v2 ([#10889](https://github.com/linode/manager/pull/10889)) |
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
96 changes: 96 additions & 0 deletions
96
packages/manager/cypress/e2e/core/linodes/create-linode-region-select.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,96 @@ | ||
import { ui } from 'support/ui'; | ||
import { | ||
regionFactory, | ||
} from '@src/factories'; | ||
import { mockGetRegions } from 'support/intercepts/regions'; | ||
import { extendRegion } from 'support/util/regions'; | ||
|
||
import type { ExtendedRegion } from 'support/util/regions'; | ||
|
||
const mockRegions: ExtendedRegion[] = [ | ||
extendRegion( | ||
regionFactory.build({ | ||
capabilities: ['Linodes'], | ||
country: 'uk', | ||
id: 'eu-west', | ||
label: 'London, UK', | ||
}) | ||
), | ||
extendRegion( | ||
regionFactory.build({ | ||
capabilities: ['Linodes'], | ||
country: 'sg', | ||
id: 'ap-south', | ||
label: 'Singapore, SG', | ||
}) | ||
), | ||
extendRegion( | ||
regionFactory.build({ | ||
capabilities: ['Linodes'], | ||
id: 'us-east', | ||
label: 'Newark, NJ', | ||
}) | ||
), | ||
extendRegion( | ||
regionFactory.build({ | ||
capabilities: ['Linodes'], | ||
id: 'us-central', | ||
label: 'Dallas, TX', | ||
}) | ||
), | ||
]; | ||
|
||
describe('Linode Create Region Select', () => { | ||
/* | ||
* Region select test. | ||
* | ||
* TODO: Cypress | ||
* Move this to cypress component testing once the setup is complete - see https://github.com/linode/manager/pull/10134 | ||
* | ||
* - Confirms that region select dropdown is visible and interactive. | ||
* - Confirms that region select dropdown is populated with expected regions. | ||
* - Confirms that region select dropdown is sorted alphabetically by region, with North America first. | ||
* - Confirms that region select dropdown is populated with expected DCs, sorted alphabetically. | ||
*/ | ||
it('region select', () => { | ||
mockGetRegions(mockRegions).as('getRegions'); | ||
|
||
cy.visitWithLogin('linodes/create'); | ||
|
||
cy.wait('@getRegions'); | ||
|
||
// Confirm that region select dropdown is visible and interactive. | ||
ui.regionSelect.find().click(); | ||
cy.get('[data-qa-autocomplete-popper="true"]').should('be.visible'); | ||
|
||
// Confirm that region select dropdown are grouped by region, | ||
// sorted alphabetically, with North America first. | ||
cy.get('.MuiAutocomplete-groupLabel') | ||
.should('have.length', 3) | ||
.should((group) => { | ||
expect(group[0]).to.contain('North America'); | ||
expect(group[1]).to.contain('Asia'); | ||
expect(group[2]).to.contain('Europe'); | ||
}); | ||
|
||
// Confirm that region select dropdown is populated with expected regions, sorted alphabetically. | ||
cy.get('[data-qa-option]').should('exist').should('have.length', 4); | ||
mockRegions.forEach((region) => { | ||
cy.get('[data-qa-option]').contains(region.label); | ||
}); | ||
|
||
// Select an option | ||
cy.findByTestId('eu-west').click(); | ||
// Confirm the popper is closed | ||
cy.get('[data-qa-autocomplete-popper="true"]').should('not.exist'); | ||
|
||
// Confirm that the selected region is displayed in the input field. | ||
cy.findByLabelText('Region').should( | ||
'have.value', | ||
'UK, London (eu-west)' | ||
); | ||
|
||
// Confirm that selecting a valid region updates the Plan Selection panel. | ||
expect(cy.get('[data-testid="table-row-empty"]').should('not.exist')); | ||
}); | ||
}); |
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
13 changes: 0 additions & 13 deletions
13
packages/manager/cypress/e2e/core/linodes/create-linode-with-add-ons.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
Oops, something went wrong.