Merge pull request #8106 from umbraco/v8/feature/cypress-test-project
Added Acceptance Test project
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -167,3 +167,10 @@ build/temp/
|
||||
# eof
|
||||
/src/Umbraco.Web.UI.Client/TESTS-*.xml
|
||||
/src/ApiDocs/api/*
|
||||
|
||||
# Acceptance tests
|
||||
cypress.env.json
|
||||
/src/Umbraco.Tests.AcceptanceTest/cypress/support/chainable.ts
|
||||
/src/Umbraco.Tests.AcceptanceTest/package-lock.json
|
||||
/src/Umbraco.Tests.AcceptanceTest/cypress/videos/
|
||||
/src/Umbraco.Tests.AcceptanceTest/cypress/screenshots/
|
||||
|
||||
@@ -381,7 +381,7 @@
|
||||
{
|
||||
Write-Host "Restore NuGet"
|
||||
Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log"
|
||||
$params = "-Source", $nugetsourceUmbraco
|
||||
$params = "-Source", $nugetsourceUmbraco
|
||||
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" > "$($this.BuildTemp)\nuget.restore.log" @params
|
||||
if (-not $?) { throw "Failed to restore NuGet packages." }
|
||||
})
|
||||
@@ -535,6 +535,7 @@
|
||||
# run
|
||||
if (-not $get)
|
||||
{
|
||||
cd
|
||||
if ($command.Length -eq 0)
|
||||
{
|
||||
$command = @( "Build" )
|
||||
|
||||
35
src/Umbraco.Tests.AcceptanceTest/README.md
Normal file
35
src/Umbraco.Tests.AcceptanceTest/README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Umbraco Acceptance Tests
|
||||
|
||||
### Prerequisite
|
||||
- NodeJS 12+
|
||||
- A running installed Umbraco on url: [https://localhost:44331](https://localhost:44331) (Default development port)
|
||||
- Install using a `SqlServer`/`LocalDb` as the tests execute too fast for `SqlCE` to handle.
|
||||
- User information in `cypress.env.json` (See [Getting started](#getting-started))
|
||||
|
||||
### Getting started
|
||||
The tests is located in the project/folder named `Umbraco.Tests.AcceptanceTests`. Ensur to run `npm install` in that folder, or let your IDE do that.
|
||||
|
||||
Next, it is important you create a new file in the root of the project called `cypress.env.json`.
|
||||
This file is already added to `.gitignore` and can contain values that is different for each developer machine.
|
||||
|
||||
The file need the following content:
|
||||
```
|
||||
{
|
||||
"username": "<email for superadmin>",
|
||||
"password": "<password for superadmin>"
|
||||
}
|
||||
```
|
||||
Replace the `<email for superadmin>` and `<password for superadmin>` placeholders with correct info.
|
||||
|
||||
|
||||
|
||||
### Executing tests
|
||||
|
||||
There exists two npm scripts, that can be used to execute the test.
|
||||
|
||||
1. `npm run test`
|
||||
- Executes the tests headless.
|
||||
1. `npm run ui`
|
||||
- Executes the tests in a browser handled by a cypress application.
|
||||
|
||||
In case of errors it is recommended to use the UI to debug.
|
||||
10
src/Umbraco.Tests.AcceptanceTest/cypress.json
Normal file
10
src/Umbraco.Tests.AcceptanceTest/cypress.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"baseUrl": "https://localhost:44331",
|
||||
"viewportHeight": 1024,
|
||||
"viewportWidth": 1200,
|
||||
"env": {
|
||||
"username": "<insert username/email in cypress.env.json>",
|
||||
"password": "<insert password in cypress.env.json>"
|
||||
},
|
||||
"supportFile": "cypress/support/index.ts"
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Login', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.visit('/umbraco');
|
||||
});
|
||||
|
||||
it('Login with correct username and password', () => {
|
||||
const username = Cypress.env('username');
|
||||
const password = Cypress.env('password');
|
||||
//Precondition
|
||||
cy.get('.text-error').should('not.exist');
|
||||
|
||||
//Action
|
||||
cy.get('#umb-username').type(username);
|
||||
cy.get('#umb-passwordTwo').type(password);
|
||||
cy.get('[label-key="general_login"]').click();
|
||||
|
||||
//Assert
|
||||
cy.url().should('include', '/umbraco#/content')
|
||||
cy.get('#umb-username').should('not.exist');
|
||||
cy.get('#umb-passwordTwo').should('not.exist');
|
||||
});
|
||||
|
||||
|
||||
it('Login with correct username but wrong password', () => {
|
||||
const username = Cypress.env('username');
|
||||
const password = 'wrong';
|
||||
|
||||
//Precondition
|
||||
cy.get('.text-error').should('not.exist');
|
||||
|
||||
//Action
|
||||
cy.get('#umb-username').type(username);
|
||||
cy.get('#umb-passwordTwo').type(password);
|
||||
cy.get('[label-key="general_login"]').click();
|
||||
|
||||
//Assert
|
||||
cy.get('.text-error').should('exist');
|
||||
cy.get('#umb-username').should('exist');
|
||||
cy.get('#umb-passwordTwo').should('exist');
|
||||
});
|
||||
|
||||
it('Login with wrong username and wrong password', () => {
|
||||
const username = 'wrong-username';
|
||||
const password = 'wrong';
|
||||
|
||||
//Precondition
|
||||
cy.get('.text-error').should('not.exist');
|
||||
|
||||
//Action
|
||||
cy.get('#umb-username').type(username);
|
||||
cy.get('#umb-passwordTwo').type(password);
|
||||
cy.get('[label-key="general_login"]').click();
|
||||
|
||||
//Assert
|
||||
cy.get('.text-error').should('exist');
|
||||
cy.get('#umb-username').should('exist');
|
||||
cy.get('#umb-passwordTwo').should('exist');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,66 @@
|
||||
/// <reference types="Cypress" />
|
||||
import {LabelDataTypeBuilder} from 'umbraco-cypress-testhelpers';
|
||||
context('Data Types', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create data type', () => {
|
||||
const name = "Test data type";
|
||||
|
||||
cy.umbracoEnsureDataTypeNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Data Types"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
cy.umbracoContextMenuAction("action-data-type").click();
|
||||
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
|
||||
cy.get('select[name="selectedEditor"]').select('Label');
|
||||
|
||||
cy.get('.umb-property-editor select').select('Time');
|
||||
|
||||
//Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureDataTypeNameNotExists(name);
|
||||
});
|
||||
|
||||
it('Delete data type', () => {
|
||||
const name = "Test data type";
|
||||
cy.umbracoEnsureDataTypeNameNotExists(name);
|
||||
|
||||
const dataType = new LabelDataTypeBuilder()
|
||||
.withSaveNewAction()
|
||||
.withName(name)
|
||||
.build();
|
||||
|
||||
cy.saveDataType(dataType);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Data Types", name]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-delete").click();
|
||||
|
||||
cy.umbracoButtonByLabelKey("general_delete").click();
|
||||
|
||||
cy.contains(name).should('not.exist');
|
||||
|
||||
cy.umbracoEnsureDataTypeNameNotExists(name);
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,79 @@
|
||||
/// <reference types="Cypress" />
|
||||
import { DocumentTypeBuilder } from 'umbraco-cypress-testhelpers';
|
||||
context('Document Types', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create document type', () => {
|
||||
const name = "Test document type";
|
||||
|
||||
cy.umbracoEnsureDocumentTypeNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Document Types"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
cy.umbracoContextMenuAction("action-documentType").click();
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
|
||||
cy.get('[data-element="group-add"]').click();
|
||||
|
||||
|
||||
cy.get('.umb-group-builder__group-title-input').type('Group name');
|
||||
cy.get('[data-element="property-add"]').click();
|
||||
cy.get('.editor-label').type('property name');
|
||||
cy.get('[data-element="editor-add"]').click();
|
||||
|
||||
//Search for textstring
|
||||
cy.get('.umb-search-field').type('Textstring');
|
||||
|
||||
// Choose first item
|
||||
cy.get('ul.umb-card-grid li a[title="Textstring"]').closest("li").click();
|
||||
|
||||
// Save property
|
||||
cy.get('.btn-success').last().click();
|
||||
|
||||
//Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureDocumentTypeNameNotExists(name);
|
||||
});
|
||||
|
||||
it('Delete document type', () => {
|
||||
const name = "Test document type";
|
||||
cy.umbracoEnsureDocumentTypeNameNotExists(name);
|
||||
|
||||
const dataType = new DocumentTypeBuilder()
|
||||
.withName(name)
|
||||
.build();
|
||||
|
||||
cy.saveDocumentType(dataType);
|
||||
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Document Types", name]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-delete").click();
|
||||
|
||||
cy.get('label.checkbox').click();
|
||||
cy.umbracoButtonByLabelKey("general_ok").click();
|
||||
|
||||
cy.contains(name).should('not.exist');
|
||||
|
||||
cy.umbracoEnsureDocumentTypeNameNotExists(name);
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Languages', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Add language', () => {
|
||||
const name = "Neddersass’sch (Nedderlannen)"; // Must be an option in the select box
|
||||
|
||||
cy.umbracoEnsureLanguageNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Languages"]).click();
|
||||
|
||||
cy.umbracoButtonByLabelKey("languages_addLanguage").click();
|
||||
|
||||
cy.get('select[name="newLang"]').select(name);
|
||||
|
||||
// //Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureLanguageNameNotExists(name);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Macros', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create macro', () => {
|
||||
const name = "Test macro";
|
||||
|
||||
cy.umbracoEnsureMacroNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Macros"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
|
||||
cy.get('form[name="createMacroForm"]').within(($form) => {
|
||||
cy.get('input[name="itemKey"]').type(name);
|
||||
cy.get(".btn-primary").click();
|
||||
});
|
||||
|
||||
cy.location().should((loc) => {
|
||||
expect(loc.hash).to.include('#/settings/macros/edit/')
|
||||
});
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureMacroNameNotExists(name);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,52 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Media Types', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create media type', () => {
|
||||
const name = "Test media type";
|
||||
|
||||
cy.umbracoEnsureMediaTypeNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Media Types"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-mediaType").click();
|
||||
|
||||
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
|
||||
cy.get('[data-element="group-add"]').click();
|
||||
|
||||
cy.get('.umb-group-builder__group-title-input').type('Group name');
|
||||
cy.get('[data-element="property-add"]').click();
|
||||
cy.get('.editor-label').type('property name');
|
||||
cy.get('[data-element="editor-add"]').click();
|
||||
|
||||
//Search for textstring
|
||||
cy.get('.umb-search-field').type('Textstring');
|
||||
|
||||
// Choose first item
|
||||
cy.get('ul.umb-card-grid li a[title="Textstring"]').closest("li").click();
|
||||
|
||||
// Save property
|
||||
cy.get('.btn-success').last().click();
|
||||
|
||||
//Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureMediaTypeNameNotExists(name);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,50 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Member Types', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create member type', () => {
|
||||
const name = "Test member type";
|
||||
|
||||
cy.umbracoEnsureMemberTypeNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Member Types"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
|
||||
cy.get('[data-element="group-add"]').click();
|
||||
|
||||
cy.get('.umb-group-builder__group-title-input').type('Group name');
|
||||
cy.get('[data-element="property-add"]').click();
|
||||
cy.get('.editor-label').type('property name');
|
||||
cy.get('[data-element="editor-add"]').click();
|
||||
|
||||
//Search for textstring
|
||||
cy.get('.umb-search-field').type('Textstring');
|
||||
|
||||
// Choose first item
|
||||
cy.get('ul.umb-card-grid li a[title="Textstring"]').closest("li").click();
|
||||
|
||||
// Save property
|
||||
cy.get('.btn-success').last().click();
|
||||
|
||||
//Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureMemberTypeNameNotExists(name);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Partial View Macro Files', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create new partial view macro', () => {
|
||||
const name = "TestPartialViewMacro";
|
||||
const fileName = name + ".cshtml";
|
||||
|
||||
cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
|
||||
cy.umbracoEnsureMacroNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Partial View Macro Files"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-label").click();
|
||||
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
//Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsurePartialViewMacroFileNameNotExists(fileName);
|
||||
cy.umbracoEnsureMacroNameNotExists(name);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Partial Views', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create new empty partial view', () => {
|
||||
const name = "TestPartialView";
|
||||
const fileName = name + ".cshtml";
|
||||
|
||||
cy.umbracoEnsurePartialViewNameNotExists(fileName);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Partial Views"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-mediaType").click();
|
||||
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
//Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsurePartialViewNameNotExists(fileName);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Relation Types', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create relation type', () => {
|
||||
const name = "Test relation type";
|
||||
|
||||
cy.umbracoEnsureRelationTypeNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Relation Types"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
|
||||
cy.get('form[name="createRelationTypeForm"]').within(($form) => {
|
||||
cy.get('input[name="relationTypeName"]').type(name);
|
||||
|
||||
cy.get('[name="relationType-direction"] input').first().click({force:true});
|
||||
|
||||
cy.get('select[name="relationType-parent"]').select('Document');
|
||||
|
||||
cy.get('select[name="relationType-child"]').select('Media');
|
||||
|
||||
cy.get(".btn-primary").click();
|
||||
});
|
||||
|
||||
cy.location().should((loc) => {
|
||||
expect(loc.hash).to.include('#/settings/relationTypes/edit/')
|
||||
})
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureRelationTypeNameNotExists(name);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Scripts', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create new JavaScript file', () => {
|
||||
const name = "TestScript";
|
||||
const fileName = name + ".js";
|
||||
|
||||
cy.umbracoEnsureScriptNameNotExists(fileName);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Stylesheets"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-mediaType").click();
|
||||
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
//Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureScriptNameNotExists(fileName);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Stylesheets', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create new style sheet file', () => {
|
||||
const name = "TestStylesheet";
|
||||
const fileName = name + ".css";
|
||||
|
||||
cy.umbracoEnsureStylesheetNameNotExists(fileName);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Stylesheets"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
cy.get('.menu-label').first().click(); // TODO: Fucked we cant use something like cy.umbracoContextMenuAction("action-mediaType").click();
|
||||
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
//Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureStylesheetNameNotExists(fileName);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Templates', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create template', () => {
|
||||
const name = "Test template";
|
||||
|
||||
cy.umbracoEnsureTemplateNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('settings');
|
||||
cy.get('li .umb-tree-root:contains("Settings")').should("be.visible");
|
||||
|
||||
cy.umbracoTreeItem("settings", ["Templates"]).rightclick();
|
||||
|
||||
cy.umbracoContextMenuAction("action-create").click();
|
||||
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
//Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureTemplateNameNotExists(name);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
context('User Groups', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create user group', () => {
|
||||
const name = "Test Group";
|
||||
|
||||
cy.umbracoEnsureUserGroupNameNotExists(name);
|
||||
|
||||
cy.umbracoSection('users');
|
||||
cy.get('[data-element="sub-view-userGroups"]').click();
|
||||
|
||||
cy.umbracoButtonByLabelKey("actions_createGroup").click();
|
||||
|
||||
//Type name
|
||||
cy.umbracoEditorHeaderName(name);
|
||||
|
||||
// Assign sections
|
||||
cy.get('.umb-box:nth-child(1) .umb-property:nth-child(1) localize').click();
|
||||
cy.get('.umb-tree-item span').click({multiple:true});
|
||||
cy.get('.btn-success').last().click();
|
||||
|
||||
// Save
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
//Assert
|
||||
cy.umbracoSuccessNotification().should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureUserGroupNameNotExists(name);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/// <reference types="Cypress" />
|
||||
context('Users', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
|
||||
});
|
||||
|
||||
it('Create user', () => {
|
||||
const name = "Alice Bobson";
|
||||
const email = "alice-bobson@acceptancetest.umbraco";
|
||||
|
||||
cy.umbracoEnsureUserEmailNotExists(email);
|
||||
cy.umbracoSection('users');
|
||||
cy.umbracoButtonByLabelKey("user_createUser").click();
|
||||
|
||||
|
||||
cy.get('input[name="name"]').type(name);
|
||||
cy.get('input[name="email"]').type(email);
|
||||
|
||||
cy.get('.umb-node-preview-add').click();
|
||||
cy.get('.umb-user-group-picker-list-item:nth-child(1) > .umb-user-group-picker__action').click();
|
||||
cy.get('.umb-user-group-picker-list-item:nth-child(2) > .umb-user-group-picker__action').click();
|
||||
cy.get('.btn-success').click();
|
||||
|
||||
cy.get('.umb-button > .btn > .umb-button__content').click();
|
||||
|
||||
|
||||
cy.umbracoButtonByLabelKey("user_goToProfile").should('be.visible');
|
||||
|
||||
//Clean up
|
||||
cy.umbracoEnsureUserEmailNotExists(email);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
21
src/Umbraco.Tests.AcceptanceTest/cypress/plugins/index.js
Normal file
21
src/Umbraco.Tests.AcceptanceTest/cypress/plugins/index.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference types="cypress" />
|
||||
// ***********************************************************
|
||||
// This example plugins/index.js can be used to load plugins
|
||||
//
|
||||
// You can change the location of this file or turn off loading
|
||||
// the plugins file with the 'pluginsFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/plugins-guide
|
||||
// ***********************************************************
|
||||
|
||||
// This function is called when a project is opened or re-opened (e.g. due to
|
||||
// the project's config changing)
|
||||
|
||||
/**
|
||||
* @type {Cypress.PluginConfig}
|
||||
*/
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
}
|
||||
30
src/Umbraco.Tests.AcceptanceTest/cypress/support/commands.js
Normal file
30
src/Umbraco.Tests.AcceptanceTest/cypress/support/commands.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add("login", (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||
|
||||
import {Command} from 'umbraco-cypress-testhelpers';
|
||||
import {Chainable} from './chainable';
|
||||
new Chainable();
|
||||
new Command().registerCypressCommands();
|
||||
20
src/Umbraco.Tests.AcceptanceTest/cypress/support/index.ts
Normal file
20
src/Umbraco.Tests.AcceptanceTest/cypress/support/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// ***********************************************************
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
7
src/Umbraco.Tests.AcceptanceTest/cypress/tsconfig.json
Normal file
7
src/Umbraco.Tests.AcceptanceTest/cypress/tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"include": [
|
||||
"../node_modules/cypress",
|
||||
"*/*.ts"
|
||||
]
|
||||
}
|
||||
5
src/Umbraco.Tests.AcceptanceTest/cypress/typings.d.ts
vendored
Normal file
5
src/Umbraco.Tests.AcceptanceTest/cypress/typings.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
// type definitions for Cypress object "cy"
|
||||
/// <reference types="Cypress" />
|
||||
|
||||
// type definitions for custom commands like "createDefaultTodos"
|
||||
// <reference types="support" />
|
||||
15
src/Umbraco.Tests.AcceptanceTest/package.json
Normal file
15
src/Umbraco.Tests.AcceptanceTest/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"scripts": {
|
||||
"test": "npx cypress run",
|
||||
"ui": "npx cypress open"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "^7.0.2",
|
||||
"ncp": "^2.0.0",
|
||||
"cypress": "^4.5.0",
|
||||
"umbraco-cypress-testhelpers": "1.0.0-beta-38"
|
||||
},
|
||||
"dependencies": {
|
||||
"typescript": "^3.9.2"
|
||||
}
|
||||
}
|
||||
36
src/Umbraco.Tests.AcceptanceTest/tsconfig.json
Normal file
36
src/Umbraco.Tests.AcceptanceTest/tsconfig.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"outDir": "./lib",
|
||||
"sourceMap": false,
|
||||
"declaration": true,
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "node",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"esModuleInterop": true,
|
||||
"importHelpers": true,
|
||||
"target": "es5",
|
||||
|
||||
"types": [
|
||||
"cypress"
|
||||
],
|
||||
"lib": [
|
||||
"es5",
|
||||
"dom"
|
||||
],
|
||||
"plugins": [
|
||||
{
|
||||
"name": "typescript-tslint-plugin",
|
||||
"alwaysShowRuleFailuresAsWarnings": false,
|
||||
"ignoreDefinitionFiles": true,
|
||||
"configFile": "tslint.json",
|
||||
"suppressWhileTypeErrorsPresent": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
]
|
||||
}
|
||||
3
src/Umbraco.Tests.AcceptanceTest/tslint.json
Normal file
3
src/Umbraco.Tests.AcceptanceTest/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["tslint:recommended", "tslint-config-prettier"]
|
||||
}
|
||||
16217
src/Umbraco.Web.UI.Client/package-lock.json
generated
16217
src/Umbraco.Web.UI.Client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -58,6 +58,11 @@ Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Umbraco.Web.UI.Client", "ht
|
||||
StartServerOnDebug = "false"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Umbraco.Tests.AcceptanceTest\", "Umbraco.Tests.AcceptanceTest\", "{9E4C8A12-FBE0-4673-8CE2-DF99D5D57817}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
SlnRelativePath = "Umbraco.Tests.AcceptanceTest\"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Web", "Umbraco.Web\Umbraco.Web.csproj", "{651E1350-91B6-44B7-BD60-7207006D7003}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Core", "Umbraco.Core\Umbraco.Core.csproj", "{31785BC3-256C-4613-B2F5-A1B0BDDED8C1}"
|
||||
@@ -159,6 +164,7 @@ Global
|
||||
{3A33ADC9-C6C0-4DB1-A613-A9AF0210DF3D} = {B5BD12C1-A454-435E-8A46-FF4A364C0382}
|
||||
{C7311C00-2184-409B-B506-52A5FAEA8736} = {FD962632-184C-4005-A5F3-E705D92FC645}
|
||||
{FB5676ED-7A69-492C-B802-E7B24144C0FC} = {B5BD12C1-A454-435E-8A46-FF4A364C0382}
|
||||
{9E4C8A12-FBE0-4673-8CE2-DF99D5D57817} = {B5BD12C1-A454-435E-8A46-FF4A364C0382}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {7A0F2E34-D2AF-4DAB-86A0-7D7764B3D0EC}
|
||||
|
||||
Reference in New Issue
Block a user