Skip to content

Playwright: Fixed parameters of startActivity() #3408

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

Merged
merged 1 commit into from
Sep 25, 2022
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
8 changes: 5 additions & 3 deletions docs/helpers/Appium.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,14 @@ Start an arbitrary Android activity during a session.
I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');
```

Appium: support only Android

#### Parameters

- `appPackage`
- `appActivity`
- `appPackage` **[string][4]**
- `appActivity` **[string][4]**

Returns **[Promise][5]<void>** Appium: support only Android
Returns **[Promise][5]<void>**

### setNetworkConnection

Expand Down
6 changes: 4 additions & 2 deletions lib/helper/Appium.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,11 @@ class Appium extends Webdriver {
* I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');
* ```
*
* @return {Promise<void>}
*
* Appium: support only Android
*
* @param {string} appPackage
* @param {string} appActivity
* @return {Promise<void>}
*/
async startActivity(appPackage, appActivity) {
onlyForApps.call(this, 'Android');
Expand Down
9 changes: 6 additions & 3 deletions typings/tests/helpers/Appium.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const appium = new CodeceptJS.Appium();

const str_ap = "text";
const num_ap = 1;
const appPackage = "com.example.android.apis";

appium.touchPerform(); // $ExpectError
appium.touchPerform("press"); // $ExpectError
Expand All @@ -16,8 +17,8 @@ appium.hideDeviceKeyboard("pressKey", "Done", "Done"); // $ExpectError

appium.removeApp(); // $ExpectError
appium.removeApp("appName"); // $ExpectType void
appium.removeApp("appName", "com.example.android.apis"); // $ExpectType void
appium.removeApp("appName", "com.example.android.apis", "remove"); // $ExpectError
appium.removeApp("appName", appPackage); // $ExpectType void
appium.removeApp("appName", appPackage, "remove"); // $ExpectError

appium.runOnIOS(str_ap, () => {}); // $ExpectType void
appium.runOnAndroid(str_ap, () => {}); // $ExpectType void
Expand All @@ -40,7 +41,9 @@ appium._switchToContext(str_ap); // $ExpectType void
appium.switchToWeb(); // $ExpectType Promise<void>
appium.switchToNative(); // $ExpectType Promise<void>
appium.switchToNative(str_ap); // $ExpectType Promise<void>
appium.startActivity(); // $ExpectType Promise<void>
appium.startActivity(); // $ExpectError
appium.startActivity(appPackage); // $ExpectError
appium.startActivity(appPackage, '.RegisterUserActivity'); // $ExpectType Promise<void>
appium.setNetworkConnection(); // $ExpectType Promise<{}>
appium.setSettings(str_ap); // $ExpectType void
appium.hideDeviceKeyboard(); // $ExpectType void
Expand Down