Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Langer <[email protected]>
  • Loading branch information
tortmayr and planger authored Oct 30, 2023
1 parent 01fd03d commit 32f95fd
Show file tree
Hide file tree
Showing 28 changed files with 2,690 additions and 2,718 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"source.organizeImports": true
},
"eslint.validate": ["javascript", "typescript"],
"prettier.prettierPath": "node_modules/prettier",
"search.exclude": {
"**/node_modules": true,
"**/lib": true
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Eclipse GLSP Playwright Changelog

## [v2.0.0 - 24/10/2023]((https://github.com/eclipse-glsp/glsp-playwright/releases/tag/v2.0.0))

Inception of the GLSP Playwright project.
This project provides a Playwright-based page object framework for testing GLSP diagrams in different tool platform integration scenarios.
149 changes: 149 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
def kubernetes_config = """
apiVersion: v1
kind: Pod
spec:
containers:
- name: node
image: eclipseglsp/ci:alpine-v5.0
tty: true
resources:
limits:
memory: "2Gi"
cpu: "1"
requests:
memory: "2Gi"
cpu: "1"
command:
- cat
volumeMounts:
- mountPath: "/home/jenkins"
name: "jenkins-home"
readOnly: false
- mountPath: "/.yarn"
name: "yarn-global"
readOnly: false
- mountPath: "/.cache"
name: "playwright-cache"
readOnly: false
volumes:
- name: "jenkins-home"
emptyDir: {}
- name: "yarn-global"
emptyDir: {}
- name: "playwright-cache"
emptyDir: {}
"""

pipeline {
agent {
kubernetes {
label 'glsp-theia-agent-pod'
yaml kubernetes_config
}
}
options {
buildDiscarder logRotator(numToKeepStr: '15')
}

environment {
YARN_CACHE_FOLDER = "${env.WORKSPACE}/yarn-cache"
SPAWN_WRAP_SHIM_ROOT = "${env.WORKSPACE}"
EMAIL_TO= "[email protected]"
}

stages {
stage('Build') {
steps {
timeout(30) {
container('node') {
sh "yarn install --unsafe-perm"
script {
// Fail the step if there are uncommited changes to the yarn.lock file
if (sh(returnStatus: true, script: 'git diff --name-only | grep -q "^yarn.lock"') == 0) {
echo 'The yarn.lock file has uncommited changes!'
error 'The yarn.lock file has uncommited changes!'
}
}
}
}
}
}

stage('Codechecks (ESLint)'){
steps {
container('node') {
timeout(30){
sh "yarn lint:ci"
}
}
}
}

stage('Deploy (main only)') {
when {
allOf {
branch 'main'
expression {
/* Only trigger the deployment job if the changeset contains changes in
the `packages` or `examples/workflow-theia` directory */
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep -q "^packages\\|examples/workflow-test"') == 0
}
}
}
steps {
container('node') {
timeout(30) {
withCredentials([string(credentialsId: 'npmjs-token', variable: 'NPM_AUTH_TOKEN')]) {
sh 'printf "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}\n" >> $WORKSPACE/.npmrc'
}
sh 'git config user.email "[email protected]"'
sh 'git config user.name "eclipse-glsp-bot"'
sh 'yarn publish:next'
}
}
}
}
}

post {
success {
// Record & publish ESLint issues
recordIssues enabledForFailure: true, publishAllIssues: true, aggregatingResults: true,
tools: [esLint(pattern: 'node_modules/**/*/eslint.xml')],
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
}
failure {
script {
if (env.BRANCH_NAME == 'main') {
echo "Build result FAILURE: Send email notification to ${EMAIL_TO}"
emailext attachLog: true,
from: '[email protected]',
body: 'Job: ${JOB_NAME}<br>Build Number: ${BUILD_NUMBER}<br>Build URL: ${BUILD_URL}',
mimeType: 'text/html', subject: 'Build ${JOB_NAME} (#${BUILD_NUMBER}) FAILURE', to: "${EMAIL_TO}"
}
}
}
unstable {
script {
if (env.BRANCH_NAME == 'main') {
echo "Build result UNSTABLE: Send email notification to ${EMAIL_TO}"
emailext attachLog: true,
from: '[email protected]',
body: 'Job: ${JOB_NAME}<br>Build Number: ${BUILD_NUMBER}<br>Build URL: ${BUILD_URL}',
mimeType: 'text/html', subject: 'Build ${JOB_NAME} (#${BUILD_NUMBER}) UNSTABLE', to: "${EMAIL_TO}"
}
}
}
fixed {
script {
if (env.BRANCH_NAME == 'main') {
echo "Build back to normal: Send email notification to ${EMAIL_TO}"
emailext attachLog: false,
from: '[email protected]',
body: 'Job: ${JOB_NAME}<br>Build Number: ${BUILD_NUMBER}<br>Build URL: ${BUILD_URL}',
mimeType: 'text/html', subject: 'Build ${JOB_NAME} back to normal (#${BUILD_NUMBER})', to: "${EMAIL_TO}"
}
}
}
}
}
9 changes: 5 additions & 4 deletions examples/workflow-test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eclipse-glsp/workflow-test",
"version": "0.1.0",
"version": "2.0.0",
"private": true,
"description": "Example project for glsp-playwright",
"homepage": "https://www.eclipse.org/glsp/",
Expand Down Expand Up @@ -35,7 +35,7 @@
"clean": "rimraf lib tsconfig.tsbuildinfo server/*.log",
"lint": "eslint --ext .ts,.tsx ./src ./tests",
"lint:all": "yarn check-types && yarn lint",
"lint:fix": "yarn lint --fix",
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
"prepare": "yarn clean && yarn build && yarn lint && playwright install",
"start:server": "node node_modules/@eclipse-glsp-examples/workflow-server-bundled/wf-glsp-server-node.js",
"test": "playwright test",
Expand All @@ -45,9 +45,10 @@
"watch": "tsc -w"
},
"devDependencies": {
"@eclipse-glsp-examples/workflow-server-bundled": "next",
"@eclipse-glsp/glsp-playwright": "0.1.0",
"@eclipse-glsp-examples/workflow-server-bundled": "~2.0.1",
"@eclipse-glsp/glsp-playwright": "~2.0.0",
"@playwright/test": "^1.34.3",
"@theia/playwright": "^1.39.0",
"commander": "^10.0.1",
"dotenv": "^16.0.3",
"mvn-artifact-download": "5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/workflow-test/src/app/workflow-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
import { GLSPApp } from '@eclipse-glsp/glsp-playwright';
import { WorkflowToolPalette } from '../features/tool-palette/workflow-tool-palette';
import { WorkflowGraph } from '../graph/workflow.graph';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
GLSPToolPaletteOptions,
ToolPaletteContentGroup,
ToolPaletteContentItem
} from '@eclipse-glsp/glsp-playwright/glsp';
} from '@eclipse-glsp/glsp-playwright';

export class WorkflowToolPalette extends GLSPToolPalette {
override readonly content: WorkflowToolPaletteContent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { NodeMetadata } from '@eclipse-glsp/glsp-playwright';
import { PNode } from '@eclipse-glsp/glsp-playwright/glsp';
import { NodeMetadata, PNode } from '@eclipse-glsp/glsp-playwright';

@NodeMetadata({
type: 'activityNode:fork'
Expand Down
3 changes: 1 addition & 2 deletions examples/workflow-test/src/graph/elements/edge.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Mix, useClickableFlow, useRoutingPointCapability } from '@eclipse-glsp/glsp-playwright/extension';
import { EdgeMetadata, PEdge } from '@eclipse-glsp/glsp-playwright/glsp';
import { EdgeMetadata, Mix, PEdge, useClickableFlow, useRoutingPointCapability } from '@eclipse-glsp/glsp-playwright/';

const EdgeMixin = Mix(PEdge).flow(useClickableFlow).capability(useRoutingPointCapability).build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Mix, useClickableFlow, useRenameableFlow } from '@eclipse-glsp/glsp-playwright/extension';
import { ModelElementMetadata, PLabel } from '@eclipse-glsp/glsp-playwright/glsp';
import { Mix, ModelElementMetadata, PLabel, useClickableFlow, useRenameableFlow } from '@eclipse-glsp/glsp-playwright/';

export const LabelHeadingMixin = Mix(PLabel).flow(useClickableFlow).flow(useRenameableFlow).build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import {
ChildrenAccessor,
Mix,
NodeMetadata, PNode, SVGMetadataUtils,
useClickableFlow,
useCommandPaletteCapability,
useDraggableFlow,
useHoverableFlow,
useMarkerCapability,
usePopupCapability,
useResizeHandleCapability
} from '@eclipse-glsp/glsp-playwright/extension';
import { ChildrenAccessor, NodeMetadata, PNode, SVGMetadataUtils } from '@eclipse-glsp/glsp-playwright/glsp';
} from '@eclipse-glsp/glsp-playwright/';
import { LabelHeading } from './label-heading.po';

export const TaskAutomatedMixin = Mix(PNode)
Expand Down
6 changes: 4 additions & 2 deletions examples/workflow-test/src/graph/elements/task-manual.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import {
ChildrenAccessor,
Mix,
NodeMetadata,
PLabelledElement,
PNode, SVGMetadataUtils,
useClickableFlow,
useCommandPaletteCapability,
useDeletableFlow,
Expand All @@ -24,8 +27,7 @@ import {
usePopupCapability,
useRenameableFlow,
useResizeHandleCapability
} from '@eclipse-glsp/glsp-playwright/extension';
import { ChildrenAccessor, NodeMetadata, PNode, SVGMetadataUtils } from '@eclipse-glsp/glsp-playwright/glsp';
} from '@eclipse-glsp/glsp-playwright/';
import { LabelHeading } from './label-heading.po';

export const TaskManualMixin = Mix(PNode)
Expand Down
3 changes: 1 addition & 2 deletions examples/workflow-test/src/graph/workflow.graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPSemanticGraph, PNode, PNodeConstructor } from '@eclipse-glsp/glsp-playwright/glsp';
import { waitForFunction } from '@eclipse-glsp/glsp-playwright/integration';
import { GLSPSemanticGraph, PNode, PNodeConstructor, waitForFunction } from '@eclipse-glsp/glsp-playwright/';

export class WorkflowGraph extends GLSPSemanticGraph {
override async waitForCreationOfNodeType<TElement extends PNode>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp, GLSPGlobalCommandPalette } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, GLSPGlobalCommandPalette, expect, test } from '@eclipse-glsp/glsp-playwright/';
import { WorkflowApp } from '../../src/app/workflow-app';
import { Edge } from '../../src/graph/elements/edge.po';
import { TaskAutomated } from '../../src/graph/elements/task-automated.po';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, expect, test } from '@eclipse-glsp/glsp-playwright/';
import { WorkflowApp } from '../../src/app/workflow-app';
import { ActivityNodeFork } from '../../src/graph/elements/activity-node-fork.po';
import { Edge } from '../../src/graph/elements/edge.po';
Expand Down
3 changes: 1 addition & 2 deletions examples/workflow-test/tests/features/edge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, expect, test } from '@eclipse-glsp/glsp-playwright/';
import { WorkflowApp } from '../../src/app/workflow-app';
import { ActivityNodeFork } from '../../src/graph/elements/activity-node-fork.po';
import { Edge } from '../../src/graph/elements/edge.po';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, expect, test } from '@eclipse-glsp/glsp-playwright/';
import { WorkflowApp } from '../../../src/app/workflow-app';
import { TaskManual } from '../../../src/graph/elements/task-manual.po';
import { WorkflowGraph } from '../../../src/graph/workflow.graph';
Expand Down
3 changes: 1 addition & 2 deletions examples/workflow-test/tests/features/graph.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, expect, test } from '@eclipse-glsp/glsp-playwright/';
import { WorkflowApp } from '../../src/app/workflow-app';
import { ActivityNodeFork } from '../../src/graph/elements/activity-node-fork.po';
import { Edge } from '../../src/graph/elements/edge.po';
Expand Down
3 changes: 1 addition & 2 deletions examples/workflow-test/tests/features/marker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, expect, test } from '@eclipse-glsp/glsp-playwright/';
import { WorkflowApp } from '../../src/app/workflow-app';
import { TaskAutomated } from '../../src/graph/elements/task-automated.po';
import { WorkflowGraph } from '../../src/graph/workflow.graph';
Expand Down
3 changes: 1 addition & 2 deletions examples/workflow-test/tests/features/parent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, expect, test } from '@eclipse-glsp/glsp-playwright/';
import { WorkflowApp } from '../../src/app/workflow-app';
import { LabelHeading } from '../../src/graph/elements/label-heading.po';
import { TaskManual } from '../../src/graph/elements/task-manual.po';
Expand Down
3 changes: 1 addition & 2 deletions examples/workflow-test/tests/features/popup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, expect, test } from '@eclipse-glsp/glsp-playwright/';
import { dedent } from 'ts-dedent';
import { WorkflowApp } from '../../src/app/workflow-app';
import { TaskManual } from '../../src/graph/elements/task-manual.po';
Expand Down
4 changes: 1 addition & 3 deletions examples/workflow-test/tests/features/resize-handle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { ResizeHandle } from '@eclipse-glsp/glsp-playwright';
import { GLSPApp, PMetadata } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, PMetadata, ResizeHandle, expect, test } from '@eclipse-glsp/glsp-playwright';
import { WorkflowApp } from '../../src/app/workflow-app';
import { TaskManual } from '../../src/graph/elements/task-manual.po';
import { WorkflowGraph } from '../../src/graph/workflow.graph';
Expand Down
3 changes: 1 addition & 2 deletions examples/workflow-test/tests/features/routing-point.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { GLSPApp } from '@eclipse-glsp/glsp-playwright/glsp';
import { expect, test } from '@eclipse-glsp/glsp-playwright/test';
import { GLSPApp, expect, test } from '@eclipse-glsp/glsp-playwright/';
import { WorkflowApp } from '../../src/app/workflow-app';
import { Edge } from '../../src/graph/elements/edge.po';
import { WorkflowGraph } from '../../src/graph/workflow.graph';
Expand Down
Loading

0 comments on commit 32f95fd

Please sign in to comment.