it('should return the window size', async () => { const response = await api.getWindowSize(session.sessionId, {windowHandle: 'current'}); assert.equal(response.status, 0); assert.isAbove(response.value.width, 0); assert.isAbove(response.value.height, 0); });
it("arrayLengthCompare", () => { assert.isAbove(Utils.arrayLengthCompare([1, 2], []), 0); assert.strictEqual(Utils.arrayLengthCompare([1, 2], [1, 2]), 0); assert.isBelow(Utils.arrayLengthCompare([], [1, 2]), 0); assert.isAbove(Utils.arrayLengthCompare([1]), 0); assert.strictEqual(Utils.arrayLengthCompare(), 0); assert.isBelow(Utils.arrayLengthCompare(undefined, [1]), 0); });
it('should return an element list on the page', async () => { const response = await api.findElements(session.sessionId, {using: 'css selector', value: 'input'}); assert.equal(response.status, 0); assert.isAbove(response.value.length, 1); });
it("extracts clinical data from parsed input", () => { assert.deepEqual(getClinicalData(parseInput(partiallyAnnotatedMutationInput)), [], "partially annotation mutation input should NOT have any clinical data"); assert.deepEqual(getClinicalData(parseInput(minimalMutationInput)), [], "minimal mutation input should NOT have any clinical data"); assert.deepEqual(getClinicalData(parseInput(basicMutationInput)), [], "basic mutation input should NOT have any clinical data"); const clinicalData = getClinicalData(parseInput(mutationInputWithClinicalData)); assert.isAbove(clinicalData.length, 0, "mutation input with clinical data should have clinical data"); assert.equal(clinicalData[0].clinicalAttributeId, "CANCER_TYPE"); assert.equal(clinicalData[0].value, "CancerType1"); assert.equal(clinicalData[0].sampleId, "TCGA-13-0760"); assert.equal(clinicalData[2].clinicalAttributeId, "CANCER_TYPE"); assert.equal(clinicalData[2].value, "CancerType2"); assert.equal(clinicalData[2].sampleId, "TCGA-AP-A051"); assert.equal(clinicalData[4].clinicalAttributeId, "CANCER_TYPE"); assert.equal(clinicalData[4].value, "CancerType3"); assert.equal(clinicalData[4].sampleId, "TCGA-BS-A0UF"); assert.equal(clinicalData[7].clinicalAttributeId, "CANCER_TYPE"); assert.equal(clinicalData[7].value, "CancerType4"); assert.equal(clinicalData[7].sampleId, "Unknown"); });
return safe.nfs.getDir(client, { dirPath: topLevelPath, isPathShared: scenario.shared }).then(resp => { assert.lengthOf(resp.subDirectories, 0) assert.lengthOf(resp.files, 1) assert.equal(resp.files[0].name, fileName) assert.equal(resp.files[0].size, 0) // Is in the past 20 seconds? assert.isBelow(resp.files[0].createdOn, Date.now()) assert.isAbove(resp.files[0].createdOn, Date.now() - (20 * 1000)) })
return safe.nfs.getDir(client, { dirPath: '/', isPathShared: scenario.shared }).then(resp => { const foundDir = resp.subDirectories.find(dir => dir.name == topLevelName) assert.isNotNull(foundDir) assert.equal(foundDir.isPrivate, scenario.private) assert.equal(foundDir.metadata, '') assert.equal(foundDir.createdOn, foundDir.modifiedOn) // Is in the past 20 seconds? assert.isBelow(foundDir.createdOn, Date.now()) assert.isAbove(foundDir.createdOn, Date.now() - (20 * 1000)) })
it('should pause task', () => { let newState = rootReducer(initialState, { type: "PAUSE_TASK", boardId: 0, taskId: 0, progress: 10 }); chai.assert.equal(newState.getIn(["boardList", 0, "taskList", 0, 'isPlaying']), false); chai.assert.equal(newState.getIn(["activeTask", 'isPlaying']), false); chai.assert.isAbove(newState.getIn(["boardList", 0, "taskList", 0, 'progress']), initialState.getIn(["boardList", 0, "taskList", 0, 'progress'])) });
@test('Get all employees') public async allEmployees() { let result = await getAllEmployees(); assert.isArray(result, 'Expected result to be an array'); assert.isAbove(result.length, 5, 'Expected more than 5 employees in array'); validateRecordColumns( { recordType: 'employee', functionName: 'getAllEmployees' }, result[3], REQUIRED_EMPLOYEE_LIST_COLS ); }
@test('All customers') public async allCustomers() { let result = await getAllCustomers(); assert.isArray(result, 'Expected result to be an array'); assert.isAbove(result.length, 20, 'Expected over 20 customers in array'); validateRecordColumns( { recordType: 'customer', functionName: 'getAllCustomers' }, result[3], REQUIRED_CUSTOMER_LIST_COLS, FORBIDDEN_CUSTOMER_LIST_COLS ); }
@test('All orders') public async allOrders() { let result = await getAllOrders({ perPage: 50000 }); assert.isArray(result, 'Expected result to be an array'); assert.isAbove(result.length, 9000, 'Expected over 9000 orders in array'); validateRecordColumns( { recordType: 'order', functionName: 'getAllOrders' }, result[3], REQUIRED_ORDER_LIST_COLS, FORBIDDEN_ORDER_LIST_COLS ); }