Skip to content

Commit

Permalink
test: [M3-8316,M3-8317] - Tag cypress tests by adding the "method:e2e…
Browse files Browse the repository at this point in the history
…" and "purpose:dcTesting" (linode#10915)

* tag cypress tests

* Added changeset: Tag cypress tests by adding the method:e2e and purpose:dcTesting

* Update cy.tag
  • Loading branch information
AzureLatte authored and nikhagra-akamai committed Sep 23, 2024
1 parent c135328 commit 754d5ee
Show file tree
Hide file tree
Showing 40 changed files with 150 additions and 29 deletions.
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10915-tests-1725992312603.md
Original file line number Diff line number Diff line change
@@ -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))
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ui } from 'support/ui';

describe('Logout Test', () => {
beforeEach(() => {
cy.tag('purpose:syntheticTesting');
cy.tag('purpose:syntheticTesting', 'method:e2e');
});

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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<Linode> => {
const payload = createLinodeRequestFactory.build({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('create image (e2e)', () => {
});

it('create image from a linode', () => {
cy.tag('method:e2e');
const label = randomLabel();
const description = randomPhrase();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ describe('Linode Config management', () => {
}
);
});
beforeEach(() => {
cy.tag('method:e2e');
});

/*
* - Tests Linode config creation end-to-end using real API requests.
Expand Down
39 changes: 14 additions & 25 deletions packages/manager/cypress/e2e/core/linodes/linode-storage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -97,6 +101,9 @@ const addDisk = (diskName: string) => {
};

authenticate();
beforeEach(() => {
cy.tag('method:e2e');
});
describe('linode storage tab', () => {
before(() => {
cleanUp(['linodes', 'lke-clusters']);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ authenticate();
describe('resize linode', () => {
beforeEach(() => {
cleanUp(['linodes']);
cy.tag('method:e2e');
});

it('resizes a linode by increasing size: warm migration', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ authenticate();
describe('switch linode state', () => {
beforeEach(() => {
cleanUp(['linodes']);
cy.tag('method:e2e');
});

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ authenticate();
describe('update linode label', () => {
beforeEach(() => {
cleanUp(['linodes']);
cy.tag('method:e2e');
});

it('updates a linode label from details page', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ const createNodeBalancerWithUI = (
};

authenticate();
beforeEach(() => {
cy.tag('method:e2e', 'purpose:dcTesting');
});
describe('create NodeBalancer', () => {
before(() => {
cleanUp(['tags', 'node-balancers', 'linodes']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ const assertStatusForUrlAtAlias = (
};

authenticate();
beforeEach(() => {
cy.tag('method:e2e');
});
describe('object storage end-to-end tests', () => {
before(() => {
cleanUp('obj-buckets');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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');
Expand Down
Loading

0 comments on commit 754d5ee

Please sign in to comment.