diff --git a/app/lib/methods/withTest.ts b/app/lib/methods/withTest.ts new file mode 100644 index 000000000..3f6cdccee --- /dev/null +++ b/app/lib/methods/withTest.ts @@ -0,0 +1,4 @@ +export const withTest = (testID: string): { testID: string; accessibilityLabel: string } => ({ + testID, + accessibilityLabel: testID +}); diff --git a/app/views/NewServerView/ServerInput/index.tsx b/app/views/NewServerView/ServerInput/index.tsx index ddb7e6772..c296f0141 100644 --- a/app/views/NewServerView/ServerInput/index.tsx +++ b/app/views/NewServerView/ServerInput/index.tsx @@ -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 ? ( { }); 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'); diff --git a/appium/wdio.conf.js b/appium/wdio.conf.js deleted file mode 100644 index 2aa08ae22..000000000 --- a/appium/wdio.conf.js +++ /dev/null @@ -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'] -};