Skip to content

Commit

Permalink
merge in approved PRs, add rename field, comment out as (pending remo…
Browse files Browse the repository at this point in the history
…val)
  • Loading branch information
Jason Byrne committed Nov 23, 2021
1 parent eeb11dd commit a05d500
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagpole",
"version": "2.6.19",
"version": "2.6.20",
"description": "Simple and fast DOM integration, headless or headful browser, and REST API testing framework.",
"files": [
"dist/",
Expand Down
1 change: 1 addition & 0 deletions src/assertioncontext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ export class AssertionContext implements iAssertionContext {

public set(aliasName: string, value: any): iAssertionContext {
this._scenario.set(aliasName, value);

return this;
}

Expand Down
3 changes: 2 additions & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ export interface iValue {
col(key: string): iValue;
groupBy(key: string): iValue;
unique(): iValue;
as(aliasName: string): iValue;
//as(aliasName: string): iValue;
rename(newName: string): iValue;
echo(callback: (str: string) => void): iValue;
echo(): iValue;
// DOM Elements only
Expand Down
9 changes: 9 additions & 0 deletions src/value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ export class Value implements iValue {
this._highlight = highlight;
}

public rename(newName: string): iValue {
const oldName = this.name;
this._name = newName;
this._completedAction("RENAME", `${oldName} to ${newName}`);
return this;
}

public toArray(): any[] {
return this.isArray() ? this._input : [this._input];
}
Expand Down Expand Up @@ -341,10 +348,12 @@ export class Value implements iValue {
return value == thisValue.$;
}

/*
public as(aliasName: string): iValue {
this._context.scenario.set(aliasName, this);
return this;
}
*/

public async getProperty(key: string): Promise<iValue> {
return this._wrapAsValue(
Expand Down

0 comments on commit a05d500

Please sign in to comment.