Skip to content

Commit

Permalink
Merge pull request #33 from ShellyDCMS/node-8
Browse files Browse the repository at this point in the history
node 18
  • Loading branch information
ShellyDCMS committed Oct 18, 2023
2 parents c82ed43 + 6a86718 commit a716182
Show file tree
Hide file tree
Showing 21 changed files with 1,000 additions and 995 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/npm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18.18.2
registry-url: https://registry.npmjs.org/
- run: npx yarn install --frozen-lockfile
- run: npm run build
- run: npm run cy:run
- run: npm run generate-md-docs
- name: Tests Report
uses: phoenix-actions/test-reporting@v8
id: test-report
if: always()
id: test-report
if: always()
with:
name: Cypress Tests
path: ${{ github.workspace }}/cypress/results/json/mochawesome.json
reporter: mochawesome-json

2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npx yarn install --frozen-lockfile
- run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion documents/classes/CypressAngularComponentHelper.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@shellygo/cypress-test-utils - v1.0.47](../README.md) / [Modules](../modules.md) / CypressAngularComponentHelper
[@shellygo/cypress-test-utils - v2.0.0](../README.md) / [Modules](../modules.md) / CypressAngularComponentHelper

# Class: CypressAngularComponentHelper<T\>

Expand Down
2 changes: 1 addition & 1 deletion documents/classes/CypressHelper.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@shellygo/cypress-test-utils - v1.0.47](../README.md) / [Modules](../modules.md) / CypressHelper
[@shellygo/cypress-test-utils - v2.0.0](../README.md) / [Modules](../modules.md) / CypressHelper

# Class: CypressHelper

Expand Down
2 changes: 1 addition & 1 deletion documents/classes/CypressHelperOptions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@shellygo/cypress-test-utils - v1.0.47](../README.md) / [Modules](../modules.md) / CypressHelperOptions
[@shellygo/cypress-test-utils - v2.0.0](../README.md) / [Modules](../modules.md) / CypressHelperOptions

# Class: CypressHelperOptions

Expand Down
2 changes: 1 addition & 1 deletion documents/classes/CypressLitComponentHelper.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@shellygo/cypress-test-utils - v1.0.47](../README.md) / [Modules](../modules.md) / CypressLitComponentHelper
[@shellygo/cypress-test-utils - v2.0.0](../README.md) / [Modules](../modules.md) / CypressLitComponentHelper

# Class: CypressLitComponentHelper

Expand Down
2 changes: 1 addition & 1 deletion documents/classes/CypressReactComponentHelper.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@shellygo/cypress-test-utils - v1.0.47](../README.md) / [Modules](../modules.md) / CypressReactComponentHelper
[@shellygo/cypress-test-utils - v2.0.0](../README.md) / [Modules](../modules.md) / CypressReactComponentHelper

# Class: CypressReactComponentHelper

Expand Down
4 changes: 2 additions & 2 deletions documents/modules.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[@shellygo/cypress-test-utils - v1.0.47](README.md) / Modules
[@shellygo/cypress-test-utils - v2.0.0](README.md) / Modules

# @shellygo/cypress-test-utils - v1.0.47
# @shellygo/cypress-test-utils - v2.0.0

## Table of contents

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shellygo/cypress-test-utils",
"description": "Cypress Test Automation Utilities",
"version": "1.0.47",
"version": "2.0.0",
"author": "Shelly Goldblit",
"private": false,
"license": "MIT",
Expand Down Expand Up @@ -88,6 +88,6 @@
],
"engines": {
"npm": ">=6.0.0",
"node": ">=14.18.0"
"node": ">=18.18.2"
}
}
65 changes: 0 additions & 65 deletions src/angular/cypress-angular-component-helper.ts

This file was deleted.

66 changes: 65 additions & 1 deletion src/angular/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,65 @@
export { CypressAngularComponentHelper } from "./cypress-angular-component-helper";
import type { Type } from "@angular/core";
import { ComponentFixture } from "@angular/core/testing";
import { MountConfig } from "cypress/angular";
/**
* @class CypressAngularComponentHelper was designed designed for mounting angular components
* @template T - component type
* @classdes CypressAngularComponentHelper exposes the following public properties:
* @property when - enables mounting of an Angular component
* @property get - enables getting the mounted component
*/
export class CypressAngularComponentHelper<T> {
private fixture: any;
public when = {
/**
* mount an angular component, with autoSpyOutputs set to true, meaning all event emitters are automatically spied on
* and be accessed during a test using
* ```ts
* helper.get.spy("<EventEmitterName>")
* ```
* @example
* ```ts
* helper.when.mount(
* Type<AvatarComponent>,
* {
* declarations: [AvatarComponent],
* },
* {
* initials: 'JD',
* picture: 'assets/avatar/def-user-male.png',
* }
* )
* ```
* @param componentType
* @param config
* @param componentProperties
*/
mount: (
componentType: Type<T> | string,
config: MountConfig<T>,
componentProperties?: Partial<{
[P in keyof T]: T[P];
}>
) => {
// @ts-ignore
const mountResponse = cy.mount<T>(componentType, {
...config,
autoSpyOutputs: true,
componentProperties: {
...config.componentProperties,
...componentProperties
}
});
mountResponse.its("fixture").then((fixture: ComponentFixture<T>) => {
this.fixture = fixture;
});
}
};
public get = {
/**
* Get mounted component
* @returns {ComponentFixture<T>}
*/
component: (): T => this.fixture.componentInstance
};
}
Loading

0 comments on commit a716182

Please sign in to comment.