Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into remove-rstudio-int-test-extraneous-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SanketD92 authored Nov 19, 2021
2 parents e7cf88c + bb9e457 commit 7078b6d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,68 @@
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
import _ from 'lodash';
import {
terminateWorkspaces,
launchWorkspace,
navigateToWorkspaces,
checkDetailsTable,
checkWorkspaceAvailable,
} from '../../support/workspace-util';

describe('Launch a workspace', () => {
const workspaceNames = [];
before(() => {
cy.login('researcher');
navigateToWorkspaces();
terminateWorkspaces();
});
after(() => {
// Wait until all new workspaces are available and then terminate them
_.forEach(workspaceNames, workspaceName => {
checkWorkspaceAvailable(workspaceName);
});
terminateWorkspaces();
});

// Do RStudio create first as we need to test when this becomes available as well
it('should launch a new RStudio Server workspace correctly', () => {
const workspaces = Cypress.env('workspaces');
const rstudioServer = workspaces.rstudioServer;
const workspaceName = launchWorkspace(rstudioServer, 'RStudio-Server');
workspaceNames.push(workspaceName);
checkDetailsTable(workspaceName);
});

it('should launch a new sagemaker workspace correctly', () => {
const workspaces = Cypress.env('workspaces');
const sagemaker = workspaces.sagemaker;
const workspaceName = launchWorkspace(sagemaker, 'Sagemaker');
workspaceNames.push(workspaceName);
checkDetailsTable(workspaceName);
});

it('should launch a new ec2 Linux workspace correctly', () => {
const workspaces = Cypress.env('workspaces');
const ec2 = workspaces.ec2;
const workspaceName = launchWorkspace(ec2.linux, 'Linux');
workspaceNames.push(workspaceName);
checkDetailsTable(workspaceName);
});

it('should launch a new ec2 Windows workspace correctly', () => {
const workspaces = Cypress.env('workspaces');
const ec2 = workspaces.ec2;
const workspaceName = launchWorkspace(ec2.windows, 'Windows');
workspaceNames.push(workspaceName);
checkDetailsTable(workspaceName);
});

it('should launch a new emr workspace correctly', () => {
const workspaces = Cypress.env('workspaces');
const emr = workspaces.emr;
const workspaceName = launchWorkspace(emr, 'EMR');
workspaceNames.push(workspaceName);
checkDetailsTable(workspaceName);
});
});
7 changes: 7 additions & 0 deletions main/end-to-end-tests/cypress/support/workspace-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,17 @@ function checkWorkspaceAvailableAndClickConnectionsButton(workspaceName) {
.click();
}

function checkWorkspaceAvailable(workspaceName) {
cy.contains(workspaceName)
.parent()
.contains('AVAILABLE', { timeout: 1000000 });
}

module.exports = {
terminateWorkspaces,
launchWorkspace,
navigateToWorkspaces,
checkDetailsTable,
checkWorkspaceAvailableAndClickConnectionsButton,
checkWorkspaceAvailable,
};

0 comments on commit 7078b6d

Please sign in to comment.