For Flutter app, we are using
appium-flutter-finder
andappium-flutter-driver
webdriverIO
framework usingTypescript
Scenario:
- Login page: Username and password, click on login button
- Redirected to home page and a dialog is displayed where the user need to click on option Got it!
Issue:
- During the execution, I’m able to see the dialog with the Got it! option but the option is not clicked
- To click on the option, using the below logic:
const gotITButtonLocator = byText('Got it!');
const element = driver.$(gotITButtonLocator);
await element.click();
Terminal logs:
ERROR webdriver: Request failed with status 405 due to unknown method: Not implemented yet for find.
[0-0] unknown method in "My Driver Dashboard.should login with valid credentials and Click on Got it"
unknown method: Not implemented yet for find.
at Context.<anonymous> (/Users/prabhakary/Documents/Ziing/Mobile/VSCODE/mobile-e2e-test/tests
/shared/specs/driver/test_driver.e2e.ts:66:9)
Appium server logs:
[f3380dda][FlutterDriver@bade] Encountered internal error running command:NotImplementedError: Not implemented yet for find.
I kindly requesting for help on this scenario:
import { expect, driver, $ } from "@wdio/globals";
import { selectors } from "../../../../helpers/selectors.ts";
import { pause } from "../../../../helpers/utilities.ts";
import { byText, byValueKey } from "appium-flutter-finder";
const dotenv = require("dotenv");
const loginPage = require('../../../shared/pageObjects/login.page.ts');
const env = process.env.TEST_ENV || "demo";
dotenv.config({ path: `env/.env.${env}` });
describe("My Driver Dashboard", () => {
beforeEach(async () => {});
it("should find and click the OK button", async () => {
await pause(3000);
const buttonText = await driver.getElementText(selectors.continueButton);
if (buttonText === "OK") {
console.log("OK button is displayed. Clicking the OK button...");
await driver.elementClick(selectors.continueButton);
} else {
console.log("OK button is not displayed.");
}
});
it("should login with valid credentials and Click on Got it", async () => {
const email = process.env.EMAIL;
const password = process.env.PASSWORD;
// Accept the permissions
await loginPage.loginFlow(email, password);
console.log('Login completed..Checking for the "Got it" button.');
await pause(10000);
// Click the "Got it" button
const gotITButtonLocator = byText('Got it!');
await pause(10000);
console.log('********** "Got it" TEXT. **********', gotITButtonLocator);
const element = driver.$(gotITButtonLocator);
await element.click();
await pause(10000);
});
});
Below is the source code snippet for flutter
if (!approvedShowOnce) {
showDialog(
context: context,
builder: (BuildContext context) {
return const OkCancelPopup(
popupTitle: DASHBOARD_DIALOG_APPROVED_TITLE,
popupContent: DASHBOARD_DIALOG_APPROVED_CONTENT,
okButtonText: DASHBOARD_DIALOG_GOT_BUTTON,
cancelButtonText: null,
okHandler: null,
cancelHandler: null,
);
},
);
The DASHBOARD_DIALOG_GOT_BUTTON ,
const DASHBOARD_DIALOG_GOT_BUTTON = 'Got it!';
1