diff --git a/packages/manager/.changeset/pr-10915-tests-1725992312603.md b/packages/manager/.changeset/pr-10915-tests-1725992312603.md new file mode 100644 index 00000000000..6d7703fd558 --- /dev/null +++ b/packages/manager/.changeset/pr-10915-tests-1725992312603.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tests +--- + +Tag cypress tests by adding the "method:e2e" and "purpose:dcTesting" ([#10915](https://github.com/linode/manager/pull/10915)) diff --git a/packages/manager/cypress/e2e/core/account/account-logout.spec.ts b/packages/manager/cypress/e2e/core/account/account-logout.spec.ts index bb72c9795b4..550c4b39c98 100644 --- a/packages/manager/cypress/e2e/core/account/account-logout.spec.ts +++ b/packages/manager/cypress/e2e/core/account/account-logout.spec.ts @@ -4,7 +4,7 @@ import { ui } from 'support/ui'; describe('Logout Test', () => { beforeEach(() => { - cy.tag('purpose:syntheticTesting'); + cy.tag('purpose:syntheticTesting', 'method:e2e'); }); /* diff --git a/packages/manager/cypress/e2e/core/account/service-transfer.spec.ts b/packages/manager/cypress/e2e/core/account/service-transfer.spec.ts index 71428f889ea..51c3059d59f 100644 --- a/packages/manager/cypress/e2e/core/account/service-transfer.spec.ts +++ b/packages/manager/cypress/e2e/core/account/service-transfer.spec.ts @@ -121,6 +121,7 @@ describe('Account service transfers', () => { * - Confirms user can navigate to service transfer page via user menu. */ it('can navigate to service transfers landing page', () => { + cy.tag('method:e2e'); cy.visitWithLogin('/'); cy.findByLabelText('Profile & Account').should('be.visible').click(); @@ -244,6 +245,7 @@ describe('Account service transfers', () => { * - Confirms that users can cancel a service transfer */ it('can initiate and cancel a service transfer', () => { + cy.tag('method:e2e'); // Create a Linode to transfer. const setupLinode = async (): Promise => { const payload = createLinodeRequestFactory.build({ diff --git a/packages/manager/cypress/e2e/core/domains/smoke-clone-domain.spec.ts b/packages/manager/cypress/e2e/core/domains/smoke-clone-domain.spec.ts index d45a2bf886d..4e9b28fb0b9 100644 --- a/packages/manager/cypress/e2e/core/domains/smoke-clone-domain.spec.ts +++ b/packages/manager/cypress/e2e/core/domains/smoke-clone-domain.spec.ts @@ -14,6 +14,9 @@ describe('Clone a Domain', () => { before(() => { cleanUp('domains'); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Clicks "Clone" action menu item for domain but cancels operation. diff --git a/packages/manager/cypress/e2e/core/domains/smoke-create-domain-records.spec.ts b/packages/manager/cypress/e2e/core/domains/smoke-create-domain-records.spec.ts index 3b1cb74e422..950719ce399 100644 --- a/packages/manager/cypress/e2e/core/domains/smoke-create-domain-records.spec.ts +++ b/packages/manager/cypress/e2e/core/domains/smoke-create-domain-records.spec.ts @@ -4,6 +4,9 @@ import { interceptCreateDomainRecord } from 'support/intercepts/domains'; import { createDomainRecords } from 'support/constants/domains'; authenticate(); +beforeEach(() => { + cy.tag('method:e2e'); +}); describe('Creates Domains records with Form', () => { it('Adds domain records to a newly created Domain', () => { diff --git a/packages/manager/cypress/e2e/core/domains/smoke-create-domain.spec.ts b/packages/manager/cypress/e2e/core/domains/smoke-create-domain.spec.ts index 04d206a0bc8..e3d8d513de1 100644 --- a/packages/manager/cypress/e2e/core/domains/smoke-create-domain.spec.ts +++ b/packages/manager/cypress/e2e/core/domains/smoke-create-domain.spec.ts @@ -16,6 +16,7 @@ describe('Create a Domain', () => { }); it('Creates first Domain', () => { + cy.tag('method:e2e'); // Mock Domains to modify incoming response. const mockDomains = new Array(2).fill(null).map( (_item: null, index: number): Domain => { diff --git a/packages/manager/cypress/e2e/core/domains/smoke-delete-domain.spec.ts b/packages/manager/cypress/e2e/core/domains/smoke-delete-domain.spec.ts index 80d9b632aa2..4e9223cca14 100644 --- a/packages/manager/cypress/e2e/core/domains/smoke-delete-domain.spec.ts +++ b/packages/manager/cypress/e2e/core/domains/smoke-delete-domain.spec.ts @@ -7,6 +7,9 @@ import { createDomain } from '@linode/api-v4/lib/domains'; import { ui } from 'support/ui'; authenticate(); +beforeEach(() => { + cy.tag('method:e2e'); +}); describe('Delete a Domain', () => { /* * - Clicks "Delete" action menu item for domain but cancels operation. diff --git a/packages/manager/cypress/e2e/core/firewalls/create-firewall.spec.ts b/packages/manager/cypress/e2e/core/firewalls/create-firewall.spec.ts index 4da8d8c2dab..3007167215a 100644 --- a/packages/manager/cypress/e2e/core/firewalls/create-firewall.spec.ts +++ b/packages/manager/cypress/e2e/core/firewalls/create-firewall.spec.ts @@ -12,6 +12,9 @@ describe('create firewall', () => { before(() => { cleanUp(['lke-clusters', 'linodes', 'firewalls']); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Creates a firewall that is not assigned to a Linode. diff --git a/packages/manager/cypress/e2e/core/firewalls/delete-firewall.spec.ts b/packages/manager/cypress/e2e/core/firewalls/delete-firewall.spec.ts index 2cbedb29e5f..7be2db7cd11 100644 --- a/packages/manager/cypress/e2e/core/firewalls/delete-firewall.spec.ts +++ b/packages/manager/cypress/e2e/core/firewalls/delete-firewall.spec.ts @@ -11,6 +11,9 @@ describe('delete firewall', () => { before(() => { cleanUp('firewalls'); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Clicks "Delete" action menu item for firewall but cancels operation. diff --git a/packages/manager/cypress/e2e/core/firewalls/migrate-linode-with-firewall.spec.ts b/packages/manager/cypress/e2e/core/firewalls/migrate-linode-with-firewall.spec.ts index f8feabaf6db..2074a0785db 100644 --- a/packages/manager/cypress/e2e/core/firewalls/migrate-linode-with-firewall.spec.ts +++ b/packages/manager/cypress/e2e/core/firewalls/migrate-linode-with-firewall.spec.ts @@ -144,6 +144,7 @@ describe('Migrate Linode With Firewall', () => { * - Uses real API data to create a Firewall, attach a Linode to it, then migrate the Linode. */ it('migrates linode with firewall - real data', () => { + cy.tag('method:e2e', 'purpose:dcTesting'); const [migrationRegionStart, migrationRegionEnd] = chooseRegions(2); const firewallLabel = randomLabel(); const linodePayload = createLinodeRequestFactory.build({ diff --git a/packages/manager/cypress/e2e/core/firewalls/update-firewall.spec.ts b/packages/manager/cypress/e2e/core/firewalls/update-firewall.spec.ts index d67ac52fd3a..7269f369631 100644 --- a/packages/manager/cypress/e2e/core/firewalls/update-firewall.spec.ts +++ b/packages/manager/cypress/e2e/core/firewalls/update-firewall.spec.ts @@ -170,6 +170,9 @@ describe('update firewall', () => { before(() => { cleanUp('firewalls'); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Confirms that a linode can be added and removed from a firewall. diff --git a/packages/manager/cypress/e2e/core/general/account-activation.spec.ts b/packages/manager/cypress/e2e/core/general/account-activation.spec.ts index c6ab1764182..1c5273e999b 100644 --- a/packages/manager/cypress/e2e/core/general/account-activation.spec.ts +++ b/packages/manager/cypress/e2e/core/general/account-activation.spec.ts @@ -1,5 +1,8 @@ import { apiMatcher } from 'support/util/intercepts'; +beforeEach(() => { + cy.tag('method:e2e'); +}); describe('account activation', () => { /** * The API will return 403 with the body below for most endpoint except `/v4/profile`. diff --git a/packages/manager/cypress/e2e/core/general/smoke-deep-link.spec.ts b/packages/manager/cypress/e2e/core/general/smoke-deep-link.spec.ts index bc9f2af2951..e11f5707ae6 100644 --- a/packages/manager/cypress/e2e/core/general/smoke-deep-link.spec.ts +++ b/packages/manager/cypress/e2e/core/general/smoke-deep-link.spec.ts @@ -1,7 +1,9 @@ import { pages } from 'support/ui/constants'; - import type { Page } from 'support/ui/constants'; +beforeEach(() => { + cy.tag('method:e2e'); +}); describe('smoke - deep links', () => { beforeEach(() => { cy.visitWithLogin('/null'); diff --git a/packages/manager/cypress/e2e/core/images/create-image.spec.ts b/packages/manager/cypress/e2e/core/images/create-image.spec.ts index b118a4cad41..8ea89934bab 100644 --- a/packages/manager/cypress/e2e/core/images/create-image.spec.ts +++ b/packages/manager/cypress/e2e/core/images/create-image.spec.ts @@ -49,6 +49,7 @@ describe('create image (e2e)', () => { }); it('create image from a linode', () => { + cy.tag('method:e2e'); const label = randomLabel(); const description = randomPhrase(); diff --git a/packages/manager/cypress/e2e/core/images/search-images.spec.ts b/packages/manager/cypress/e2e/core/images/search-images.spec.ts index 9620a2312e7..8da716b8d33 100644 --- a/packages/manager/cypress/e2e/core/images/search-images.spec.ts +++ b/packages/manager/cypress/e2e/core/images/search-images.spec.ts @@ -13,6 +13,9 @@ describe('Search Images', () => { before(() => { cleanUp(['linodes', 'images']); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Confirm that images are API searchable and filtered in the UI. diff --git a/packages/manager/cypress/e2e/core/kubernetes/lke-create.spec.ts b/packages/manager/cypress/e2e/core/kubernetes/lke-create.spec.ts index bff073133a9..f354607d4a0 100644 --- a/packages/manager/cypress/e2e/core/kubernetes/lke-create.spec.ts +++ b/packages/manager/cypress/e2e/core/kubernetes/lke-create.spec.ts @@ -81,6 +81,7 @@ describe('LKE Cluster Creation', () => { * - Confirms that correct information is shown on the LKE cluster summary page */ it('can create an LKE cluster', () => { + cy.tag('method:e2e', 'purpose:dcTesting'); const clusterLabel = randomLabel(); const clusterRegion = chooseRegion(); const clusterVersion = '1.27'; diff --git a/packages/manager/cypress/e2e/core/linodes/backup-linode.spec.ts b/packages/manager/cypress/e2e/core/linodes/backup-linode.spec.ts index f973a37651d..54eaf02e5b6 100644 --- a/packages/manager/cypress/e2e/core/linodes/backup-linode.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/backup-linode.spec.ts @@ -41,6 +41,7 @@ describe('linode backups', () => { * - Confirms that Linode details page updates to reflect that backups are enabled. */ it('can enable backups', () => { + cy.tag('method:e2e'); // Skip or optionally fail if test account has Managed enabled. // This is necessary because Managed accounts have backups enabled implicitly. expectManagedDisabled(); @@ -107,6 +108,7 @@ describe('linode backups', () => { * - Confirms that backups page content updates to reflect new snapshot. */ it('can capture a manual snapshot', () => { + cy.tag('method:e2e'); // Create a Linode that is not booted and which has backups enabled. const createLinodeRequest = createLinodeRequestFactory.build({ label: randomLabel(), diff --git a/packages/manager/cypress/e2e/core/linodes/clone-linode.spec.ts b/packages/manager/cypress/e2e/core/linodes/clone-linode.spec.ts index c64e43abba6..55a1ce53a76 100644 --- a/packages/manager/cypress/e2e/core/linodes/clone-linode.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/clone-linode.spec.ts @@ -47,6 +47,7 @@ describe('clone linode', () => { * - Confirms that Linode can be cloned successfully. */ it('can clone a Linode from Linode details page', () => { + cy.tag('method:e2e', 'purpose:dcTesting'); const linodeRegion = chooseRegion({ capabilities: ['Vlans'] }); const linodePayload = createLinodeRequestFactory.build({ label: randomLabel(), diff --git a/packages/manager/cypress/e2e/core/linodes/linode-config.spec.ts b/packages/manager/cypress/e2e/core/linodes/linode-config.spec.ts index 2e73ca80de0..68ec28b9701 100644 --- a/packages/manager/cypress/e2e/core/linodes/linode-config.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/linode-config.spec.ts @@ -91,6 +91,9 @@ describe('Linode Config management', () => { } ); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Tests Linode config creation end-to-end using real API requests. diff --git a/packages/manager/cypress/e2e/core/linodes/linode-storage.spec.ts b/packages/manager/cypress/e2e/core/linodes/linode-storage.spec.ts index 0e256bbbb41..9403d258e72 100644 --- a/packages/manager/cypress/e2e/core/linodes/linode-storage.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/linode-storage.spec.ts @@ -5,7 +5,11 @@ import { createTestLinode } from 'support/util/linodes'; import { containsVisible, fbtClick, fbtVisible } from 'support/helpers'; import { ui } from 'support/ui'; import { cleanUp } from 'support/util/cleanup'; -import { apiMatcher } from 'support/util/intercepts'; +import { + interceptDeleteDisks, + interceptAddDisks, + interceptResizeDisks, +} from 'support/intercepts/linodes'; // 3 minutes. const LINODE_PROVISION_TIMEOUT = 180_000; @@ -97,6 +101,9 @@ const addDisk = (diskName: string) => { }; authenticate(); +beforeEach(() => { + cy.tag('method:e2e'); +}); describe('linode storage tab', () => { before(() => { cleanUp(['linodes', 'lke-clusters']); @@ -105,10 +112,7 @@ describe('linode storage tab', () => { it('try to delete in use disk', () => { const diskName = 'Debian 11 Disk'; cy.defer(() => createTestLinode({ booted: true })).then((linode) => { - cy.intercept( - 'DELETE', - apiMatcher(`linode/instances/${linode.id}/disks/*`) - ).as('deleteDisk'); + interceptDeleteDisks(linode.id).as('deleteDisk'); cy.visitWithLogin(`linodes/${linode.id}/storage`); containsVisible('RUNNING'); fbtVisible(diskName); @@ -128,14 +132,8 @@ describe('linode storage tab', () => { it('delete disk', () => { const diskName = 'cy-test-disk'; cy.defer(() => createTestLinode({ image: null })).then((linode) => { - cy.intercept( - 'DELETE', - apiMatcher(`linode/instances/${linode.id}/disks/*`) - ).as('deleteDisk'); - cy.intercept( - 'POST', - apiMatcher(`linode/instances/${linode.id}/disks`) - ).as('addDisk'); + interceptDeleteDisks(linode.id).as('deleteDisk'); + interceptAddDisks(linode.id).as('addDisk'); cy.visitWithLogin(`/linodes/${linode.id}/storage`); addDisk(diskName); fbtVisible(diskName); @@ -160,10 +158,7 @@ describe('linode storage tab', () => { it('add a disk', () => { const diskName = 'cy-test-disk'; cy.defer(() => createTestLinode({ image: null })).then((linode: Linode) => { - cy.intercept( - 'POST', - apiMatcher(`/linode/instances/${linode.id}/disks`) - ).as('addDisk'); + interceptAddDisks(linode.id).as('addDisk'); cy.visitWithLogin(`/linodes/${linode.id}/storage`); addDisk(diskName); fbtVisible(diskName); @@ -174,14 +169,8 @@ describe('linode storage tab', () => { it('resize disk', () => { const diskName = 'Debian 10 Disk'; cy.defer(() => createTestLinode({ image: null })).then((linode: Linode) => { - cy.intercept( - 'POST', - apiMatcher(`linode/instances/${linode.id}/disks`) - ).as('addDisk'); - cy.intercept( - 'POST', - apiMatcher(`linode/instances/${linode.id}/disks/*/resize`) - ).as('resizeDisk'); + interceptAddDisks(linode.id).as('addDisk'); + interceptResizeDisks(linode.id).as('resizeDisk'); cy.visitWithLogin(`/linodes/${linode.id}/storage`); addDisk(diskName); fbtVisible(diskName); diff --git a/packages/manager/cypress/e2e/core/linodes/rebuild-linode.spec.ts b/packages/manager/cypress/e2e/core/linodes/rebuild-linode.spec.ts index 2c2c98ce89b..dd0314af1b0 100644 --- a/packages/manager/cypress/e2e/core/linodes/rebuild-linode.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/rebuild-linode.spec.ts @@ -110,6 +110,7 @@ describe('rebuild linode', () => { * - Confirms that password complexity */ it('rebuilds a linode from Image', () => { + cy.tag('method:e2e'); const weakPassword = 'abc123'; const fairPassword = 'Akamai123'; @@ -164,6 +165,7 @@ describe('rebuild linode', () => { * - Confirms that a Linode can be rebuilt using a Community StackScript. */ it('rebuilds a linode from Community StackScript', () => { + cy.tag('method:e2e'); const stackScriptId = '443929'; const stackScriptName = 'OpenLiteSpeed-WordPress'; const image = 'AlmaLinux 9'; @@ -226,6 +228,7 @@ describe('rebuild linode', () => { * - Confirms that a Linode can be rebuilt using an Account StackScript. */ it('rebuilds a linode from Account StackScript', () => { + cy.tag('method:e2e'); const image = 'Alpine'; const region = 'us-east'; diff --git a/packages/manager/cypress/e2e/core/linodes/rescue-linode.spec.ts b/packages/manager/cypress/e2e/core/linodes/rescue-linode.spec.ts index 533eac2535f..07e1c262ff0 100644 --- a/packages/manager/cypress/e2e/core/linodes/rescue-linode.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/rescue-linode.spec.ts @@ -38,6 +38,7 @@ describe('Rescue Linodes', () => { * - Confirms that toast appears confirming successful reboot into rescue mode. */ it('Can reboot a Linode into rescue mode', () => { + cy.tag('method:e2e'); const linodePayload = createLinodeRequestFactory.build({ label: randomLabel(), region: chooseRegion().id, diff --git a/packages/manager/cypress/e2e/core/linodes/resize-linode.spec.ts b/packages/manager/cypress/e2e/core/linodes/resize-linode.spec.ts index 02e2cfc7e17..d3ab5c2bd09 100644 --- a/packages/manager/cypress/e2e/core/linodes/resize-linode.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/resize-linode.spec.ts @@ -9,6 +9,7 @@ authenticate(); describe('resize linode', () => { beforeEach(() => { cleanUp(['linodes']); + cy.tag('method:e2e'); }); it('resizes a linode by increasing size: warm migration', () => { diff --git a/packages/manager/cypress/e2e/core/linodes/smoke-delete-linode.spec.ts b/packages/manager/cypress/e2e/core/linodes/smoke-delete-linode.spec.ts index 13ad0efaf4b..5520041418f 100644 --- a/packages/manager/cypress/e2e/core/linodes/smoke-delete-linode.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/smoke-delete-linode.spec.ts @@ -67,6 +67,9 @@ describe('delete linode', () => { before(() => { cleanUp(['linodes', 'lke-clusters']); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); it('deletes linode from linode details page', () => { const linodeCreatePayload = createLinodeRequestFactory.build({ diff --git a/packages/manager/cypress/e2e/core/linodes/switch-linode-state.spec.ts b/packages/manager/cypress/e2e/core/linodes/switch-linode-state.spec.ts index 7375e3e1e27..c0e03a30ea6 100644 --- a/packages/manager/cypress/e2e/core/linodes/switch-linode-state.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/switch-linode-state.spec.ts @@ -8,6 +8,7 @@ authenticate(); describe('switch linode state', () => { beforeEach(() => { cleanUp(['linodes']); + cy.tag('method:e2e'); }); /* diff --git a/packages/manager/cypress/e2e/core/linodes/update-linode-labels.spec.ts b/packages/manager/cypress/e2e/core/linodes/update-linode-labels.spec.ts index 4e87aa948a2..08c14da2a33 100644 --- a/packages/manager/cypress/e2e/core/linodes/update-linode-labels.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/update-linode-labels.spec.ts @@ -8,6 +8,7 @@ authenticate(); describe('update linode label', () => { beforeEach(() => { cleanUp(['linodes']); + cy.tag('method:e2e'); }); it('updates a linode label from details page', () => { diff --git a/packages/manager/cypress/e2e/core/nodebalancers/smoke-create-nodebal.spec.ts b/packages/manager/cypress/e2e/core/nodebalancers/smoke-create-nodebal.spec.ts index 3155ecc1d53..63c1e8080cf 100644 --- a/packages/manager/cypress/e2e/core/nodebalancers/smoke-create-nodebal.spec.ts +++ b/packages/manager/cypress/e2e/core/nodebalancers/smoke-create-nodebal.spec.ts @@ -78,6 +78,9 @@ const createNodeBalancerWithUI = ( }; authenticate(); +beforeEach(() => { + cy.tag('method:e2e', 'purpose:dcTesting'); +}); describe('create NodeBalancer', () => { before(() => { cleanUp(['tags', 'node-balancers', 'linodes']); diff --git a/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts index 85688840e98..17fda30faa9 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/access-key.e2e.spec.ts @@ -21,6 +21,9 @@ describe('object storage access key end-to-end tests', () => { before(() => { cleanUp(['obj-buckets', 'obj-access-keys']); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Creates an access key with unlimited access diff --git a/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts b/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts index 1c17e3e7596..8599f4a1621 100644 --- a/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts +++ b/packages/manager/cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts @@ -155,6 +155,9 @@ const assertStatusForUrlAtAlias = ( }; authenticate(); +beforeEach(() => { + cy.tag('method:e2e'); +}); describe('object storage end-to-end tests', () => { before(() => { cleanUp('obj-buckets'); diff --git a/packages/manager/cypress/e2e/core/oneClickApps/one-click-apps.spec.ts b/packages/manager/cypress/e2e/core/oneClickApps/one-click-apps.spec.ts index f453f6b7153..a6961e86709 100644 --- a/packages/manager/cypress/e2e/core/oneClickApps/one-click-apps.spec.ts +++ b/packages/manager/cypress/e2e/core/oneClickApps/one-click-apps.spec.ts @@ -23,6 +23,7 @@ import { mockGetAllImages } from 'support/intercepts/images'; describe('OneClick Apps (OCA)', () => { it('Lists all the OneClick Apps', () => { + cy.tag('method:e2e'); interceptGetStackScripts().as('getStackScripts'); cy.visitWithLogin(`/linodes/create?type=One-Click`); diff --git a/packages/manager/cypress/e2e/core/stackscripts/create-stackscripts.spec.ts b/packages/manager/cypress/e2e/core/stackscripts/create-stackscripts.spec.ts index 7619780800d..c2fa9e65557 100644 --- a/packages/manager/cypress/e2e/core/stackscripts/create-stackscripts.spec.ts +++ b/packages/manager/cypress/e2e/core/stackscripts/create-stackscripts.spec.ts @@ -172,6 +172,9 @@ describe('Create stackscripts', () => { before(() => { cleanUp(['linodes', 'images', 'stackscripts']); }); + beforeEach(() => { + cy.tag('method:e2e', 'purpose:dcTesting'); + }); /* * - Creates a StackScript with user-defined fields. diff --git a/packages/manager/cypress/e2e/core/stackscripts/smoke-community-stackscripts.spec.ts b/packages/manager/cypress/e2e/core/stackscripts/smoke-community-stackscripts.spec.ts index 43ae5fa6dc0..26453578d7b 100644 --- a/packages/manager/cypress/e2e/core/stackscripts/smoke-community-stackscripts.spec.ts +++ b/packages/manager/cypress/e2e/core/stackscripts/smoke-community-stackscripts.spec.ts @@ -190,6 +190,7 @@ describe('Community Stackscripts integration tests', () => { * - Confirms that pagination works as expected. */ it('pagination works with infinite scrolling', () => { + cy.tag('method:e2e'); interceptGetStackScripts().as('getStackScripts'); // Fetch all public Images to later use while filtering StackScripts. @@ -263,6 +264,7 @@ describe('Community Stackscripts integration tests', () => { * - Confirms that search can filter the expected results. */ it('search function filters results correctly', () => { + cy.tag('method:e2e'); const stackScript = mockStackScripts[0]; interceptGetStackScripts().as('getStackScripts'); diff --git a/packages/manager/cypress/e2e/core/volumes/attach-volume.spec.ts b/packages/manager/cypress/e2e/core/volumes/attach-volume.spec.ts index 76c2ec63a0f..41c53259a98 100644 --- a/packages/manager/cypress/e2e/core/volumes/attach-volume.spec.ts +++ b/packages/manager/cypress/e2e/core/volumes/attach-volume.spec.ts @@ -50,6 +50,9 @@ describe('volume attach and detach flows', () => { before(() => { cleanUp(['volumes', 'linodes']); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Clicks "Attach" action menu item for volume, selects Linode with common region, and submits form. diff --git a/packages/manager/cypress/e2e/core/volumes/clone-volume.spec.ts b/packages/manager/cypress/e2e/core/volumes/clone-volume.spec.ts index f589c9b979b..e65a582243b 100644 --- a/packages/manager/cypress/e2e/core/volumes/clone-volume.spec.ts +++ b/packages/manager/cypress/e2e/core/volumes/clone-volume.spec.ts @@ -35,6 +35,9 @@ describe('volume clone flow', () => { before(() => { cleanUp('volumes'); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Clicks "Clone" action menu item for volume, enters new label, and submits form. diff --git a/packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts b/packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts index ff4d3deb0dd..eea86e8d44e 100644 --- a/packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts +++ b/packages/manager/cypress/e2e/core/volumes/create-volume.spec.ts @@ -53,7 +53,7 @@ describe('volume create flow', () => { * - Confirms that volume is listed correctly on volumes landing page. */ it('creates an unattached volume', () => { - cy.tag('purpose:syntheticTesting'); + cy.tag('purpose:syntheticTesting', 'method:e2e', 'purpose:dcTesting'); const region = chooseRegion(); const volume = { @@ -98,6 +98,7 @@ describe('volume create flow', () => { * - Confirms that volume is listed correctly on Linode 'Storage' details page. */ it('creates an attached volume', () => { + cy.tag('method:e2e', 'purpose:dcTesting'); const region = chooseRegion(); const linodeRequest = createLinodeRequestFactory.build({ @@ -352,6 +353,7 @@ describe('volume create flow', () => { * - Confirms that volume is listed correctly on Volumes landing page. */ it('creates a volume from an existing Linode', () => { + cy.tag('method:e2e'); const linodeRequest = createLinodeRequestFactory.build({ label: randomLabel(), root_pass: randomString(16), diff --git a/packages/manager/cypress/e2e/core/volumes/delete-volume.spec.ts b/packages/manager/cypress/e2e/core/volumes/delete-volume.spec.ts index 7897d0c7f2c..6828618fb70 100644 --- a/packages/manager/cypress/e2e/core/volumes/delete-volume.spec.ts +++ b/packages/manager/cypress/e2e/core/volumes/delete-volume.spec.ts @@ -20,6 +20,9 @@ describe('volume delete flow', () => { before(() => { cleanUp('volumes'); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Clicks "Delete" action menu item for volume but cancels operation. diff --git a/packages/manager/cypress/e2e/core/volumes/resize-volume.spec.ts b/packages/manager/cypress/e2e/core/volumes/resize-volume.spec.ts index f1ef8a5ddb7..74b9955ea76 100644 --- a/packages/manager/cypress/e2e/core/volumes/resize-volume.spec.ts +++ b/packages/manager/cypress/e2e/core/volumes/resize-volume.spec.ts @@ -35,6 +35,9 @@ describe('volume resize flow', () => { before(() => { cleanUp('volumes'); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Clicks "Resize" action menu item for volume, enters new size, and submits form. diff --git a/packages/manager/cypress/e2e/core/volumes/search-volumes.spec.ts b/packages/manager/cypress/e2e/core/volumes/search-volumes.spec.ts index e6fc05b38b0..4b95b1a407f 100644 --- a/packages/manager/cypress/e2e/core/volumes/search-volumes.spec.ts +++ b/packages/manager/cypress/e2e/core/volumes/search-volumes.spec.ts @@ -1,7 +1,6 @@ import { createVolume } from '@linode/api-v4/lib/volumes'; import { Volume } from '@linode/api-v4'; import { ui } from 'support/ui'; - import { authenticate } from 'support/api/authentication'; import { randomLabel } from 'support/util/random'; import { cleanUp } from 'support/util/cleanup'; @@ -11,6 +10,9 @@ describe('Search Volumes', () => { before(() => { cleanUp(['volumes']); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Confirm that volumes are API searchable and filtered in the UI. diff --git a/packages/manager/cypress/e2e/core/volumes/update-volume.spec.ts b/packages/manager/cypress/e2e/core/volumes/update-volume.spec.ts index e5a3d9f5de0..70f4840bbad 100644 --- a/packages/manager/cypress/e2e/core/volumes/update-volume.spec.ts +++ b/packages/manager/cypress/e2e/core/volumes/update-volume.spec.ts @@ -11,6 +11,9 @@ describe('volume update flow', () => { before(() => { cleanUp(['tags', 'volumes']); }); + beforeEach(() => { + cy.tag('method:e2e'); + }); /* * - Confirms that volume label and tags can be changed from the Volumes landing page. diff --git a/packages/manager/cypress/support/intercepts/linodes.ts b/packages/manager/cypress/support/intercepts/linodes.ts index 00b2e4c3f1b..2a665ac49bc 100644 --- a/packages/manager/cypress/support/intercepts/linodes.ts +++ b/packages/manager/cypress/support/intercepts/linodes.ts @@ -295,6 +295,51 @@ export const mockGetLinodeDisks = ( ); }; +/** + * Intercepts DELETE request to delete a Linode's Disks + * + * @param linodeId - ID of Linode for intercepted request. + * + * @returns Cypress chainable. + */ +export const interceptDeleteDisks = ( + linodeId: number +): Cypress.Chainable => { + return cy.intercept( + 'DELETE', + apiMatcher(`linode/instances/${linodeId}/disks/*`) + ); +}; + +/** + * Intercepts POST request to add a Linode's Disks + * + * @param linodeId - ID of Linode for intercepted request. + * + * @returns Cypress chainable. + */ +export const interceptAddDisks = ( + linodeId: number +): Cypress.Chainable => { + return cy.intercept('POST', apiMatcher(`linode/instances/${linodeId}/disks`)); +}; + +/** + * Intercepts POST request to resize a Linode's Disks + * + * @param linodeId - ID of Linode for intercepted request. + * + * @returns Cypress chainable. + */ +export const interceptResizeDisks = ( + linodeId: number +): Cypress.Chainable => { + return cy.intercept( + 'POST', + apiMatcher(`linode/instances/${linodeId}/disks/*/resize`) + ); +}; + /** * Intercepts DELETE request to delete linode and mocks response. *