1

Is there any way to test making photo and video with CodeceptJS Appium.

    const driver = await appium.getDriver()
    await driver.sendDeviceKeyEvent(27) 

This code actually takes picture on xiaomi device but there is still accept or decline photo button that I can't reach with this codes or any other way

Or even if there is way to mock and put pre-recorded photo or video?

Kyryl Zotov
  • 1,788
  • 5
  • 24
  • 44

1 Answers1

0

Here is for photo

const waitBetweenCommands = 3;

I.wait(waitBetweenCommands);
I.sendDeviceKeyEvent(27);
I.wait(waitBetweenCommands);
I.sendDeviceKeyEvent(27);
if (container.helpers('Appium').config.capabilities.avd) {
  I.wait(waitBetweenCommands);
  I.sendDeviceKeyEvent(55);
  I.wait(waitBetweenCommands);
  I.sendDeviceKeyEvent(61);
  I.wait(waitBetweenCommands);
  I.sendDeviceKeyEvent(62);
} else {
  I.wait(waitBetweenCommands);
  I.sendDeviceKeyEvent(66);
}
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 20 '23 at 17:48