feat!(fake-driver): wrap fake app source with <AppiumAUT> like other drivers
this will improve appium inspector compatibility
MODIFY
packages/fake-driver/lib/fake-app.js
packages/fake-driver/lib/fake-app.js
@@ -64,7 +64,7 @@ class FakeApp {
}
setDims () {
- const nodes = this.xpathQuery('/app');
+ const nodes = this.xpathQuery('//app');
const app = new FakeElement(nodes[0], this);
this._width = parseInt(app.nodeAttrs.width, 10);
this._height = parseInt(app.nodeAttrs.height, 10);
@@ -75,6 +75,9 @@ class FakeApp {
let data = await readFile(appPath);
log.info('Parsing Mock app XML');
this.rawXml = data.toString();
+ this.rawXml = this.rawXml.replace('<app ', '<AppiumAUT><app ');
+ this.rawXml = this.rawXml.replace('<app>', '<AppiumAUT><app>');
+ this.rawXml = this.rawXml.replace('</app>', '</app></AppiumAUT>');
this.dom = new XMLDom.DOMParser().parseFromString(this.rawXml);
this.activeDom = this.dom;
}

MODIFY
packages/fake-driver/test/context-tests.js
packages/fake-driver/test/context-tests.js
@@ -42,7 +42,7 @@ function contextTests () {
});
it('should go back to native context', async function () {
await driver.context('NATIVE_APP').elementByXPath('//*').getTagName()
- .should.eventually.become('app');
+ .should.eventually.become('AppiumAUT');
});
it('should not set a frame in a native context', async function () {
await driver.frame('iframe1').should.eventually.be.rejectedWith(/36/);

feat!(fake-driver): wrap fake app source with <AppiumAUT> like other drivers
this will improve appium inspector compatibility