This commit is contained in:
AlexAlexandre 2022-04-08 12:04:28 -03:00
commit f2da4ac22a
6 changed files with 41 additions and 29 deletions

View File

@ -0,0 +1,4 @@
export const withTest = (testID: string): { testID: string; accessibilityLabel: string } => ({
testID,
accessibilityLabel: testID
});

View File

@ -7,6 +7,7 @@ import { themes } from '../../../lib/constants';
import I18n from '../../../i18n';
import { TServerHistoryModel } from '../../../definitions/IServerHistory';
import Item from './Item';
import { withTest } from '../../../lib/methods/withTest';
const styles = StyleSheet.create({
container: {
@ -56,7 +57,6 @@ const ServerInput = ({
value={text}
returnKeyType='send'
onChangeText={onChangeText}
testID='new-server-view-input'
onSubmitEditing={onSubmit}
clearButtonMode='while-editing'
keyboardType='url'
@ -64,7 +64,7 @@ const ServerInput = ({
theme={theme}
onFocus={() => setFocused(true)}
onBlur={() => setFocused(false)}
accessibilityLabel='enter-workspace-url'
{...withTest('new-server-view-input')}
/>
{focused && serversHistory?.length ? (
<View

View File

@ -1,11 +1,31 @@
## Settings
- Install Node.js (Options)
- using installer `https://nodejs.org/en/download/`
- for mackbook - `brew install node`
- for windows - `choco install nodejs`
- using installer `https://nodejs.org/en/download/`
- for mackbook - `brew install node`
- for windows - `choco install nodejs`
- Download and install Appium from - `https://github.com/appium/appium-desktop/releases`.
- Download and install Appium inspector from - `https://github.com/appium/appium-inspector/releases` (Optional).
- install global dependencies for Appium using npm - `npm install -G appium`
- install global dependencies for Appium using npm - `npm install -G appium`
## Default settings for appium inspector
- Set Remote Host to: `127.0.0.1`
- Set Remote Path to: `/wd/hub`
- And update Desired Capabilities/JSON to:
```
{
"platformName": "android",
"appium:platformVersion": "12",
"appium:deviceName": "emulator",
"appium:automationName": "UiAutomator2",
"appium:appPackage": "chat.rocket.reactnative",
"appium:appActivity": "chat.rocket.reactnative.MainActivity"
}
```

View File

@ -119,5 +119,12 @@ exports.config = {
ui: 'bdd',
timeout: 60000
},
specs: ['./tests/specs/**/*.js']
specs: ['./tests/specs/**/*.js'],
beforeSuite() {
const { setup } = require('../../e2e/helpers/data_setup');
before(async () => {
await setup();
});
}
};

View File

@ -6,13 +6,13 @@ describe('Verify initial app screen', () => {
});
it('set workspace url', async () => {
await $('~enter-workspace-url').setValue('mobile');
const status = await $('~enter-workspace-url').getText();
await $('~new-server-view-input').setValue('mobile');
const status = await $('~new-server-view-input').getText();
expect(status).to.equal('mobile');
});
it('set workspace url and login', async () => {
await $('~enter-workspace-url').setValue('mobile');
await $('~new-server-view-input').setValue('mobile');
await $('~new-server-view-button').click();
const register = await $('//android.widget.TextView[@content-desc="Create an account"]').getText();
expect(register).to.equal('Create an account');

View File

@ -1,19 +0,0 @@
exports.config = {
path: '/wd/hub',
port: 4723,
capabilities: [
{
maxInstances: 1,
browserName: '',
appiumVersion: '1.22.3',
// app: 'android-official-release.apk',
platformName: 'Android',
platformVersion: '12',
deviceName: 'emulator',
automationName: 'UiAutomator2',
appPackage: 'chat.rocket.reactnative',
appActivity: 'chat.rocket.reactnative.MainActivity'
}
],
specs: ['./tests/specs/**/*.js']
};