Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,38 @@ const testOperand: TestOperandProps = {
exampleName: 'example-infinispan',
};

const operatorPackageName = 'datagrid';

const cleanupOperatorResources = () => {
cy.exec(
`oc delete subscription -l operators.coreos.com/${operatorPackageName}.${GlobalInstalledNamespace} -n ${GlobalInstalledNamespace} --ignore-not-found --wait=false`,
{ failOnNonZeroExit: false, timeout: 60000 },
);
cy.exec(
`oc delete csv -l operators.coreos.com/${operatorPackageName}.${GlobalInstalledNamespace} -n ${GlobalInstalledNamespace} --ignore-not-found --wait=false`,
{ failOnNonZeroExit: false, timeout: 60000 },
);
cy.exec(
`oc delete installplan -l operators.coreos.com/${operatorPackageName}.${GlobalInstalledNamespace} -n ${GlobalInstalledNamespace} --ignore-not-found --wait=false`,
{ failOnNonZeroExit: false, timeout: 60000 },
);
};

describe(`Globally installing "${testOperator.name}" operator in ${GlobalInstalledNamespace}`, () => {
before(() => {
cy.login();
cleanupOperatorResources();
operator.install(testOperator.name, testOperator.operatorCardTestID);
});

afterEach(() => {
checkErrors();
});

after(() => {
cleanupOperatorResources();
});

it(`Globally installs ${testOperator.name} operator in ${GlobalInstalledNamespace} and creates ${testOperand.name} operand`, () => {
operator.installedSucceeded(testOperator.name);
operator.navToDetailsPage(testOperator.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,36 @@ const testOperand: TestOperandProps = {
exampleName: 'example-backup',
};

const operatorPackageName = 'datagrid';

const cleanupOperatorResources = (namespace: string) => {
cy.exec(
`oc delete subscription -l operators.coreos.com/${operatorPackageName}.${namespace} -n ${namespace} --ignore-not-found --wait=false`,
{ failOnNonZeroExit: false, timeout: 60000 },
);
cy.exec(
`oc delete csv -l operators.coreos.com/${operatorPackageName}.${namespace} -n ${namespace} --ignore-not-found --wait=false`,
{ failOnNonZeroExit: false, timeout: 60000 },
);
cy.exec(
`oc delete installplan -l operators.coreos.com/${operatorPackageName}.${namespace} -n ${namespace} --ignore-not-found --wait=false`,
{ failOnNonZeroExit: false, timeout: 60000 },
);
};

describe(`Installing "${testOperator.name}" operator in test namespace`, () => {
before(() => {
cy.login();
cy.createProjectWithCLI(testName);
cleanupOperatorResources(testName);
});

afterEach(() => {
checkErrors();
});

after(() => {
cleanupOperatorResources(testName);
cy.deleteProjectWithCLI(testName);
});

Expand Down