Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rm obsolete design time artifacts #422

Merged
merged 6 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/wdi5-tests_ts-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ jobs:
run: npm run build

# run wdi5 tests within app(s)
# this includes test for late-injecting wdi5
- name: test ts-app
run: npm run test-h:ts-app
1 change: 1 addition & 0 deletions examples/ui5-ts-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"test": "wdio run wdio-ui5.conf.ts",
"test:authentication": "run-s authentication:*",
"test-h:authentication": "run-s \"authentication:* -- --headless\"",
"test:lateInject": "wdio run wdio-ui5-late.conf.ts",
"authentication:btp": "wdio run test/e2e/authentication/wdio-btp-authentication.conf.ts",
"authentication:basic-auth": "wdio run test/e2e/authentication/wdio-basic-auth-authentication.conf.ts",
"authentication:custom": "wdio run test/e2e/authentication/wdio-custom-authentication.conf.ts",
Expand Down
32 changes: 32 additions & 0 deletions examples/ui5-ts-app/test/e2e/ui5-late.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// only requiring the service for late inject/init
import Input from "sap/ui/webc/main/Input"
import { default as _wdi5 } from "wdio-ui5-service"
const wdi5 = new _wdi5()

describe("late inject wdi5", () => {
it('should show a non UI5 page, then advance to a UI5 page and late init "wdi5"', async () => {
// native wdio functionality - navigates to the wdi5 github page
await browser.$("#user-content-wdi5-").waitForDisplayed()
// open local app
await browser.url("http://localhost:8080/index.html")
// do the late injection
await wdi5.injectUI5()
})

it("wdi5 should subsequently work with UI5 enablement", async () => {
const webcomponentValue = await (
browser.asControl({
selector: {
bindingPath: {
modelName: "",
propertyPath: "/Customers('TRAIH')/ContactName"
},
viewName: "test.Sample.tsapp.view.Main",
controlType: "sap.ui.webc.main.Input"
}
}) as unknown as Input
).getValue()

expect(webcomponentValue).toEqual("Helvetius Nagy")
})
})
8 changes: 8 additions & 0 deletions examples/ui5-ts-app/wdio-ui5-late.conf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { config } from "./wdio-ui5.conf"

config.wdi5 = { skipInjectUI5OnStart: true }
config.specs = ["./test/e2e/ui5-late.test.ts"]
delete config.exclude
config.baseUrl = "https:/ui5-community/wdi5/"

exports.config = config
3 changes: 2 additions & 1 deletion examples/ui5-ts-app/wdio-ui5.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const config: wdi5Config = {
"./test/e2e/Custom.test.ts",
"./test/e2e/multiremote.test.ts",
"./test/e2e/BasicMultiRemoteAuthentication.test.ts",
"./test/e2e/Authentication.test.ts"
"./test/e2e/Authentication.test.ts",
"./test/e2e/ui5-late.test.ts"
],

maxInstances: 10,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"_test:js-app": "wait-on tcp:8888 && wait-on tcp:8080 && npm run test --workspace=examples/ui5-js-app",
"_test:ts-app": "wait-on tcp:8080 && npm run test --workspace=examples/ui5-ts-app",
"_test-h:js-app": "wait-on tcp:8888 && wait-on tcp:8080 && npm run test-h --workspace=examples/ui5-js-app",
"_test-h:ts-app": "wait-on tcp:8080 && npm run test -w examples/ui5-ts-app -- --headless",
"_test-h:ts-app": "wait-on tcp:8080 && npm run test -w examples/ui5-ts-app -- --headless && npm run test:lateInject -w examples/ui5-ts-app -- --headless",
"test-h:js-app": "run-p -r _startApp:js _startApp:js-tooling _test-h:js-app",
"test:ts-app": "run-p -r _startApp:ts _test:ts-app",
"test:cucumber": "npm run test --workspace=examples/cucumber",
Expand Down
8 changes: 4 additions & 4 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const Logger = _Logger.getInstance()

export default class Service implements Services.ServiceInstance {
constructor(
private _options: wdi5Config,
private _capabilities: Capabilities.RemoteCapability,
private _config: wdi5Config // an enhanced version of the regular wdio config
) {}
private _options?: wdi5Config, // TODO: this is the successor to _config in wdio^8
private _capabilities?: Capabilities.RemoteCapability,
private _config?: wdi5Config // an enhanced version of the regular wdio config
) {} // the Service is instantiated by wdio with the capabilites and config passed on to

async before(/*capabilities* , specs*/) {
// if no wdi5 config is available we add it manually
Expand Down