Skip to content

Commit

Permalink
fix(core): reverted the change to List.get and marked method as depre…
Browse files Browse the repository at this point in the history
…cated, to be removed in 3.0

Marked other deprecated APIs for removal before the official release

Related tickets: re #1403
  • Loading branch information
jan-molak committed Nov 27, 2022
1 parent 712c6ce commit 5ac8c69
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
6 changes: 5 additions & 1 deletion packages/core/src/model/tags/ContextTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { Tag } from './Tag';
* a similar icon will be used. If you use any other term for your context,
* it will appear in text form in the test results lists, so it is better to keep context names relatively short.
*
* @deprecated
* :::warning
* This tag is deprecated and will be removed in Serenity/JS 3.0.0. Use {@apilink BrowserTag} and {@apilink PlatformTag} instead.
* :::
*
* @deprecated use {@link BrowserTag} and {@link PlatformTag} instead
*/
export class ContextTag extends Tag {
static readonly Type = 'context';
Expand Down
12 changes: 12 additions & 0 deletions packages/core/src/screenplay/questions/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ export class List<Item_Type> extends Question<Promise<Item_Type[]>> {
});
}

/**
*
* :::warning
* This method is deprecated and will be removed in Serenity/JS 3.0.0. Use {@apilink List.nth} instead.
* :::
*
* @deprecated use {@link List.nth} instead
*/
get(index: number): QuestionAdapter<Item_Type> {
return this.nth(index);
}

nth(index: number): QuestionAdapter<Item_Type> {
return Question.about(`the ${ ordinal(index + 1) } of ${ this.subject }`, async actor => {
const items = await this.answeredBy(actor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ export class StartLocalServer {
* and is currently identical to calling `StartLocalServer.onPort` with the first of `preferredPorts`
* passed as an argument.
*
* :::warning
* This method is deprecated and will be removed in Serenity/JS 3.0.0.
* Please use {@apilink StartLocalServer.onPort} and {@apilink StartLocalServer.onRandomPortBetween} instead.
* :::
*
* @deprecated use {@link StartLocalServer.onPort} and {@link StartLocalServer.onRandomPortBetween} instead
*
* @param preferredPorts
* A list of preferred ports. Please note that only the first one will be used!
*
* @deprecated
* Use `StartLocalServer.onPort` or `StartLocalServer.onRandomPortBetween`
*/
static onOneOfThePreferredPorts(preferredPorts: Answerable<number[]>): Interaction {
return new StartLocalServerOnFirstOf(preferredPorts);
Expand Down

0 comments on commit 5ac8c69

Please sign in to comment.