Skip to content

Commit

Permalink
Merge pull request #12 from hammzj/dev/make-protected
Browse files Browse the repository at this point in the history
Dev/make protected
  • Loading branch information
hammzj authored Apr 16, 2024
2 parents 33f7328 + d33db39 commit 83c6463
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hammzj/cypress-page-object",
"version": "2.0.3",
"version": "2.0.4",
"description": "A set of template classes and guides to help with developing component and page objects in Cypress.",
"author": "Zachary Hamm <[email protected]>",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/page.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class InsufficientPathVariablesError extends Error {
* object, or both.
*/
export default class PageObject extends ElementCollection {
static #PATH_REPLACEMENT_REGEX = /(?<pathVariable>:\w+)/g;
public metadata: IPageMetadata;
static readonly #PATH_REPLACEMENT_REGEX = /(?<pathVariable>:\w+)/g;
protected metadata: IPageMetadata;

/**
* @example new PageObject(); //Index page
Expand Down
7 changes: 6 additions & 1 deletion src/types/page.object.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { IMetadata } from "./element.collection";

/**
* [title=] {string} Page title
* [title=] {string} If not provided, the baseUrl from the Cypress config is used from `Cypress.config().baseUrl
* [path=""] {string} Path to append to baseUrl. Can use dynamic path replacements like `/token/:someId`
*/
export interface IPageMetadata extends IMetadata {
title?: string;
baseUrl?: string; //If not provided, the baseUrl from the Cypress config is used
baseUrl?: string;
path: string | "";
}

0 comments on commit 83c6463

Please sign in to comment.