-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
genycloud: Omit preliminary login check (#4379)
- Loading branch information
Showing
7 changed files
with
3 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
detox/src/devices/allocation/drivers/android/genycloud/services/GenyAuthService.js
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
detox/src/devices/allocation/drivers/android/genycloud/services/GenyAuthService.test.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ describe('Genymotion-cloud test environment validator', () => { | |
const MOCK_GMSAAS_PATH = '/path/to/gmsaas'; | ||
|
||
let exec; | ||
let authService; | ||
let uut; | ||
beforeEach(() => { | ||
jest.mock('../../../utils/environment'); | ||
|
@@ -15,20 +14,14 @@ describe('Genymotion-cloud test environment validator', () => { | |
const GenyExec = jest.genMockFromModule('../../allocation/drivers/android/genycloud/exec/GenyCloudExec'); | ||
exec = new GenyExec(); | ||
|
||
const GenyAuthService = jest.genMockFromModule('../../allocation/drivers/android/genycloud/services/GenyAuthService'); | ||
authService = new GenyAuthService(); | ||
|
||
const GenycloudEnvValidator = require('./GenycloudEnvValidator'); | ||
uut = new GenycloudEnvValidator({ authService, exec }); | ||
uut = new GenycloudEnvValidator({ exec }); | ||
}); | ||
|
||
const givenProperGmsaasLogin = () => authService.getLoginEmail.mockResolvedValue('[email protected]'); | ||
const givenGmsaasLoggedOut = () => authService.getLoginEmail.mockResolvedValue(null); | ||
const givenGmsaasExecVersion = (version) => exec.getVersion.mockResolvedValue({ version }); | ||
const givenProperGmsaasExecVersion = () => givenGmsaasExecVersion('1.6.0'); | ||
|
||
it('should throw an error if gmsaas exec is too old (minor version < 6)', async () => { | ||
givenProperGmsaasLogin(); | ||
givenGmsaasExecVersion('1.5.9'); | ||
|
||
try { | ||
|
@@ -43,44 +36,25 @@ describe('Genymotion-cloud test environment validator', () => { | |
}); | ||
|
||
it('should accept the gmsaas exec if version is sufficiently new', async () => { | ||
givenProperGmsaasLogin(); | ||
givenGmsaasExecVersion('1.6.0'); | ||
await uut.validate(); | ||
}); | ||
|
||
it('should accept the gmsaas exec if version is more than sufficiently new', async () => { | ||
givenProperGmsaasLogin(); | ||
givenGmsaasExecVersion('1.7.2'); | ||
await uut.validate(); | ||
}); | ||
|
||
it('should throw an error if gmsaas exec is too old (major version < 1)', async () => { | ||
givenProperGmsaasLogin(); | ||
givenGmsaasExecVersion('0.6.0'); | ||
|
||
await expect(uut.validate()) | ||
.rejects | ||
.toThrowError(`Your Genymotion-Cloud executable (found in ${MOCK_GMSAAS_PATH}) is too old! (version 0.6.0)`); | ||
}); | ||
|
||
it('should throw an error if not logged-in to gmsaas', async () => { | ||
givenProperGmsaasExecVersion(); | ||
givenGmsaasLoggedOut(); | ||
|
||
try { | ||
await uut.validate(); | ||
} catch (e) { | ||
expect(e.constructor.name).toEqual('DetoxRuntimeError'); | ||
expect(e.toString()).toContain(`Cannot run tests using 'android.genycloud' type devices, because Genymotion was not logged-in to!`); | ||
expect(e.toString()).toContain(`HINT: Log-in to Genymotion-cloud by running this command (and following instructions):\n${MOCK_GMSAAS_PATH} auth login --help`); | ||
return; | ||
} | ||
throw new Error('Expected an error'); | ||
}); | ||
|
||
it('should not throw an error if properly logged in to gmsaas', async () => { | ||
givenProperGmsaasExecVersion(); | ||
givenProperGmsaasLogin(); | ||
await uut.validate(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters