`@sapui5/ts-types-esm` - `PageObjectDefinition.actions` & `assertions` function types should have a `this` parameter

Aperta
#307 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

Start at the @sapui5/ts-types-esm definition of PageObjectDefinition and inspect the actions and assertions function types. Compare them with the Opa5.createPageObjects example linked in the issue, then verify that its this.waitFor call compiles once the this type is represented.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

types
export type PageObjectDefinition = {
    //...
    actions?: Record<string, (this: Opa5) => void>;
    assertions?: Record<string, (this: Opa5) => void>;
}

otherwise this example won't compile bcause the this type is not defined:

Opa5.createPageObjects({
    onTheAppPage: {
        actions: {},

        assertions: {
            iShouldSeeTheApp: function () {
                // error: Cannot invoke an object which is possibly 'undefined'
                this.waitFor({
                    id: 'myButton',
                    actions: function () {},
                    success: function () {},
                })
            },
        },
    },
})
Lingua principale
TypeScript
Stelle
213
Fork
35
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di UI5/typescript

Tutte le issue di UI5/typescript

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.