Intern 3.4 on IOS safari - ios

When I try to execute intern script on ios simulator, safari window launches out side of simulator and opens page let's browse and further script will never execute.
this is happening for all simulators?
This was working previously, but I played little with npm install ios-deploy, tried to install it and remove it.
but since then it stopped working.
And could can anyone please tell me the need of ios-deploy in case of executing intern script on ios simulator.
I have tried shutdown erase of ios simulator and ios deploy
Sample intern.js file `define({
defaultTimeout: 900000,
reporters: [{id: 'LcovHtml', directory: 'InternHTMLResult'}, {id: 'Console'}],
  environments: [
        { platformName: 'iOS',
            deviceName: 'iPhone 6', // for example
           bundleId: 'com.apple.mobilesafari', // for example
            automationName: 'XCUITest',
browserName: 'safari',
//platformVersion: '10.3', // for example
Simulator: true,
            fixSessionCapabilities: false
      }
    ],
maxConcurrency: 5,
tunnel: 'NullTunnel',
tunnelOptions : {
port: Number('4723')
},
functionalSuites: ['tests/functional/3DExpLogin1.js'],
excludeInstrumentation: true
// excludeInstrumentation: /^(?:node_modules)//
});
`

Related

only chromium's border is visible while running test in playwright

I am using playwright to right test for our website. In playwright.config.ts I have configured to chromium browser with headless set to false. Earlier everything was working file but now while running the test the browser open but it is transparent and only border is visible. The output screenshot is also doesn't contain anything.
I am using ubuntu through wsl2 of windows 11.
The followings are still working fine with playwright:
chromium browser with headless set to true
firefox browser with either headless set to true or false
also chromium browser installed by playwright at location /xxx/xxxx/.cache/ms-playwright/chromium-1028/chrome-linux/chrome is working fine
my playwright config file is
import type { PlaywrightTestConfig } from '#playwright/test';
import dotenv from 'dotenv';
import path from 'path';
// Read from default ".env" file.
dotenv.config();
// Alternatively, read from "../my.env" file.
dotenv.config({ path: path.resolve('./my.env') });
const config: PlaywrightTestConfig = {
use: {
browserName: 'chromium',
// channel: 'chrome',
headless: false
},
webServer: {
command: ' ~/.yarn/bin/netlify dev',
port: 8888
},
testDir: './tests'
};
export default config;

I need to use Appium 2 for CodeceptJS mobile tests

Because latest iOS is making problems with Appium 1.x, Appium team is no longer supporting it,
and Appium 2 is working ok - I need to use v2...
CodeceptJS 3.3.x is using Appium 1.x now and because of the '/wd/path' used by default in CodeceptJS Appium helper, I can't set it to use Appium 2.
When starting a test, CodeceptJS fails with:
Error: Failed to create session.
The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
Please make sure Selenium Server is running and accessible
Error: Can't connect to WebDriver.
Error: Failed to create session.
The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
Please make sure Selenium Server is running and accessible
And Appium 2 fails with:
[debug] [HTTP] No route found for /wd/hub/session
[HTTP] <-- POST /wd/hub/session 404 1 ms - 211
Is there a way to change the default '/wd/path' to just '/' ?
Or is there another helper or something for Appium 2?
Part of the codecept.config.js file:
Appium: {
host: process.env.CLOUD_HOST || 'localhost',
port: parseInt(process.env.CLOUD_PORT) || 4723,
app: (PLATFORM_NAME === 'iOS') ? APP_PATH_IOS || 'com.mobile.beta' : APP_PATH_ANDROID,
desiredCapabilities: {
platformName: process.env.PLATFORM_NAME || 'iOS',
platformVersion: process.env.PLATFORM_VERSION || '16.0',
automationName: process.env.AUTOMATION_NAME || 'xcuitest',
deviceName: process.env.DEVICE_NAME || 'iPhone Xs',
appPackage: process.env.APP_PACKAGE,
appActivity: process.env.APP_ACTIVITY,
xcodeOrgId: process.env.XCODE_ORG_ID,
// udid: process.env.UDID, // used only for real iOS device
},
},
=========================================
UPDATE:
I started Appium with --base-path /wd/hub (appium --base-path /wd/hub) but now another error appears:
Error: Can't connect to WebDriver.
Error: Failed to create session.
All non-standard capabilities should have a vendor prefix. The following capabilities did not have one: platformVersion,automationName,deviceName,appPackage,appActivity,xcodeOrgId,app
Please make sure Selenium Server is running and accessible
I tried updating the capabilities in codecept.conf.js with appium: prefix, but either I do it wrong or it doesn't work:
The Update:
Appium: {
host: process.env.CLOUD_HOST || 'localhost',
port: parseInt(process.env.CLOUD_PORT) || 4723,
app: (PLATFORM_NAME === 'iOS') ? APP_PATH_IOS || 'com.mobile.beta' : APP_PATH_ANDROID,
desiredCapabilities: {
'appium:platformName': process.env.PLATFORM_NAME || 'iOS',
'appium:platformVersion': process.env.PLATFORM_VERSION || '16.0',
'appium:automationName': process.env.AUTOMATION_NAME || 'xcuitest',
'appium:deviceName': process.env.DEVICE_NAME || 'iPhone Xs',
'appium:appPackage': process.env.APP_PACKAGE, // not needed for iOS
'appium:appActivity': process.env.APP_ACTIVITY, // not needed for iOS
'xcodeOrgId': process.env.XCODE_ORG_ID, // not needed for Android
udid: process.env.UDID, // used only for real iOS device testing
},
},
Error:
Error: Can't connect to WebDriver.
Error: Invalid or unsupported WebDriver capabilities found ("platformVersion", "deviceName", "appPackage", "appActivity", "xcodeOrgId", "app", "tunnelIdentifier"). Ensure to only use valid W3C WebDriver capabilities (see https://w3c.github.io/webdriver/#capabilities).If you run your tests on a remote vendor, like Sauce Labs or BrowserStack, make sure that you put them into vendor specific capabilities, e.g. "sauce:options" or "bstack:options". Please reach out to to your vendor support team if you have further questions.
Please make sure Selenium Server is running and accessible
Error#2:
Error: Can't connect to WebDriver.
Error: Invalid or unsupported WebDriver capabilities found ("deviceName", "app", "tunnelIdentifier"). Ensure to only use valid W3C WebDriver capabilities (see https://w3c.github.io/webdriver/#capabilities).If you run your tests on a remote vendor, like Sauce Labs or BrowserStack, make sure that you put them into vendor specific capabilities, e.g. "sauce:options" or "bstack:options". Please reach out to to your vendor support team if you have further questions.
Please make sure Selenium Server is running and accessible
If you are starting Appium server using the CLI you can use something like appium -p 4726 --base-path /wd/hub which will make it accept requests on the old endpoint
Update:
With Appium 2.0, the Appium server will enforce strict compability with the W3C WebDriver specification when it comes to Capabilities. They can be found here. Anything else that you provide for Appium should have the appium: prefix (like appium:platformVersion, appium:appPackage and so on)
This is most probably a problem with the CodeceptJS's Appium helper and needs to be updated to follow the Appium's more strict compability with the W3C WebDriver specification.
The update needs a support for prefixes like:
...
appium:platformName: 'iOS'
appium:automationName: 'xcuitest'
...
or
...
browserstack:platformName: 'Android'
saucelabs:automationName: 'uiautomator2'
...
for now, we can't configure variables with prefixes.
There's also no way I know of, to contact the CodeceptJS maintainers for making this update.

Can not get the readable electron crash reports on Sentry

I'm handling crashes in our electron app with crashReporter and sending reports to sentry.io.
The goal is to see which part of JS caused the app to crash. To emulate crash I'm doing "process.crash()". To see source code trace I'm installing sentry from it's documentation, but source code never appears in sentry.
Here is the CrashReporter initialization code:
crashReporter.start({
companyName: '...',
productName: '...',
uploadToServer: true,
submitURL: 'https://....ingest.sentry.io/api/.../minidump/?sentry_key=...'
});
Sentry is added to project as:
sentry-wizard --integration electron
npm install --save-dev #sentry/cli electron-download
node sentry-symbols.js
Webpack config:
const SentryWebpackPlugin = require('#sentry/webpack-plugin');
var config = {
target: 'node',
devtool: 'source-map',
plugins: [
new webpack.ProgressPlugin(),
new webpack.EnvironmentPlugin(),
new SentryWebpackPlugin({
include: '.',
ignoreFile: '.sentrycliignore',
ignore: ['node_modules', 'webpack.config.js'],
configFile: 'sentry.properties'
})
],
...
But this is how it looks on sentry:
You are producing a native crash, what you see here is a C++ stack trace which is symbolicated. Try to throw new Error('test'); in JavaScript somewhere, then you should see a JS stack trace.

Ionic App - SQLite error "plugin_not_installed" only when running app in iOs devices

I builded an hybrid app using Ionic3+AngularJS and it uses the SQLite database.
When I run the app in Android's devices it works perfectly but when I try to run it in an iPhone or iPad I get the following error: plugin_not_installed. It happens when the app tries to create the database.
This is how it's creating the database:
public getDB(){
return this.sqlite.create({
name: 'namedatabase.db',
location: 'default'
}).catch( error => this.showError(error));
}
The catch() is called and it shows the error message "plugin_not_installed".
SQLite installed using:
$ ionic cordova plugin add cordova-sqlite-storage
$ npm install --save #ionic-native/sqlite
Any ideas?
I'm getting the same issue when I run my app in an android emulator using
ionic cordova run android -lc
When the app start, everything is ok. But after a couple of changes in my code and a save command, the app reload and show in my console
console.warn: Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins / and reinstalling them.
console.warn: 'Native: tried accessing the SQLite plugin but it's not installed.
console.warn: Install the SQLite plugin: 'ionic cordova plugin add cordova-sqlite-storage'
console.log: err "plugin_not_installed"
Even if I followed what the console asked me to do, I'm still getting the same error and it cannot create my SQLite database
What I did next is to re-run the app using the run command above, but it waste a lot of time for me to wait for the app to get started again... and again :(
createDBFile() {
this.sqlite.create({
name: DB_NAME,
location: 'default'
}).then((db: SQLiteObject) => {
this.db = db;
console.log('BDD cree')
this.stockageLocal.get('dbstatus').then(opened => {
if (opened) {
console.log('DB deja ouvert');
}
else {
console.log('create all table')
this.createTables();
}
})
}).catch(err => {
console.log(' err', JSON.stringify(err))
});
}
I had the same problem: plugin_not_installed.
I resolved putting console.log check after the promise errors and seeing that the table didn't exist.
The code:
this.sqlite.create({
name: 'ionicdb.db',
location: 'default'
})
.then((db: SQLiteObject) => {
db.executeSql('create table if not exists MY_SQLITE_STORAGE(key VARCHAR(32) PRIMARY KEY, value VARCHAR(32))', [])
.then(() => {
console.log('Executed Create table if not exists');
this.toastCtrl.create({
message: 'Table created ',
duration: 5000,
position: 'center'
}).present();
}).catch(e => console.log('error: '+JSON.stringify(e)));
}).catch(e => console.log('error: '+JSON.stringify(e)));

Not able to tap Date of birth field through 'find element by id' in Appium-ruby(Native iOS App) for automation?

Getting below error in Appium
REMOTE] Could not connect to WebKitRemoteDebugger server
info: --> GET /wd/hub/session/81921036-ccb1-4ca3-9b97-319145e345fe/contexts {}
info: [debug] [REMOTE] Getting WebKitRemoteDebugger pageArray
info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command. (Original error: connect ECONNREFUSED)","code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","origValue":"connect ECONNREFUSED"},"sessionId":"81921036-ccb1-4ca3-9b97-319145e345fe"}
info: <-- GET /wd/hub/session/81921036-ccb1-4ca3-9b97-319145e345fe/contexts 500 2.415 ms - 293
Versions used
Xcode : 7.2
Appium :1.6
Desired Capabilities:
require "appium_lib"
def caps
{
caps:{ deviceName: "YIP-25",
platformName: "iOS",
Fullreset: "false",
Noreset: "true",
app: (File.join(File.dirname(FILE), "app-fs-debug.ipa")),
Packagename: "br.com.fs.ensinabyfs",
newCommandTimeout: "3600",
autoGrantPermissions: "true",
appium_lib: { wait: 20,
debug: false,
}
}
}
end
def server_url
'http://0.0.0.0:4723/wd/hub'
end
Appium::Driver.new(caps) #Pass capabilities for appium inside the driver
Appium.promote_appium_methods Object #Makes all appium_lib methods accessible from steps
$driver.start_driver #Starts appium driver before the tests begin
Please help me out in this?
Update your xcode to 8.x latest version .
Update your Appium to 1.6.4 latest version .
Update you appium_lib gem version to latest version .
Install appium_doctor
npm install -g appium-doctor
appium-doctor --ios
This will check the health of your appium ios setup
Then run your tests as XCUITest and not as UIAutomator
Following are capabilities you can use:
You need to use capability
caps = {
:platformName => "iOS",
:deviceName => "iPhone 6",
:platformVersion => "9.3",
:app => app_path,
:noReset => 'true',
:newCommandTimeout => "30",
:automationName => "XCUITest",
:sendKeyStrategy => 'setValue'
}
Now that done, once appium starts, just try to find your element like normal web element
driver.find_element(id: 'dob').click
Hope it helps!!

Resources