I’m trying to do something very trivial with velocity and cucumber:
- Sign user up via cucumber steps
- Look in db for the saved user
The user is being saved to the test database as I would expect. I have verified this through running a query on db.users
in the cucumber db via terminal.
The problem is when I try to lookup the user in my cucumber step via Meteor.users.find()
it’s giving me a bunch of unexpected gobbledygook (which I’ve pasted at the end of this post). Can someone please help me run a query on my data from my Cucumber step?
CUCUMBER STEP - JUST TRYING TO CONSOLE.LOG THE SAVED USER
this.Then(/^I should go to the dashboard for that user$/, function (callback) {
var theUser = Meteor.users.find({});
console.log(theUser);
callback();
});
OUTPUT
{ _mongo:
I20150404-13:23:03.222(-5)? { _observeMultiplexers:
I20150404-13:23:03.222(-5)? { '{"ordered":false,"collectionName":"velocityMirrors","selector":{"framework":"cucumber","state":"ready"},"options":{"transform":null}}': [Object],
I20150404-13:23:03.222(-5)? '{"ordered":false,"collectionName":"meteor_accounts_loginServiceConfiguration","selector":{},"options":{"transform":null,"fields":{"secret":0}}}': [Object],
I20150404-13:23:03.222(-5)? '{"ordered":false,"collectionName":"velocityTestFiles","selector":{},"options":{"transform":null}}': [Object],
I20150404-13:23:03.222(-5)? '{"ordered":false,"collectionName":"velocityFixtureFiles","selector":{},"options":{"transform":null}}': [Object],
I20150404-13:23:03.222(-5)? '{"ordered":false,"collectionName":"velocityTestReports","selector":{},"options":{"transform":null}}': [Object],
I20150404-13:23:03.222(-5)? '{"ordered":false,"collectionName":"velocityAggregateReports","selector":{},"options":{"transform":null}}': [Object],
I20150404-13:23:03.223(-5)? '{"ordered":false,"collectionName":"velocityLogs","selector":{},"options":{"transform":null}}': [Object],
I20150404-13:23:03.223(-5)? '{"ordered":false,"collectionName":"velocityMirrors","selector":{},"options":{"transform":null}}': [Object],
I20150404-13:23:03.223(-5)? '{"ordered":false,"collectionName":"velocityTestFiles","selector":{"targetFramework":"cucumber"},"options":{"transform":null}}': [Object] },
I20150404-13:23:03.223(-5)? _onFailoverHook: { nextCallbackId: 9, callbacks: [Object] },
I20150404-13:23:03.223(-5)? db:
I20150404-13:23:03.223(-5)? { domain: null,
I20150404-13:23:03.224(-5)? _events: {},
I20150404-13:23:03.225(-5)? _maxListeners: 10,
I20150404-13:23:03.225(-5)? databaseName: 'meteor',
I20150404-13:23:03.225(-5)? serverConfig: [Object],
I20150404-13:23:03.225(-5)? options: [Object],
I20150404-13:23:03.225(-5)? _applicationClosed: false,
I20150404-13:23:03.226(-5)? slaveOk: false,
I20150404-13:23:03.226(-5)? bufferMaxEntries: -1,
I20150404-13:23:03.226(-5)? native_parser: false,
I20150404-13:23:03.226(-5)? bsonLib: [Object],
I20150404-13:23:03.226(-5)? bson: [Object],
I20150404-13:23:03.226(-5)? bson_deserializer: [Object],
I20150404-13:23:03.227(-5)? bson_serializer: [Object],
I20150404-13:23:03.227(-5)? _state: 'connected',
I20150404-13:23:03.227(-5)? pkFactory: [Object],
I20150404-13:23:03.227(-5)? forceServerObjectId: false,
I20150404-13:23:03.227(-5)? safe: false,
I20150404-13:23:03.227(-5)? notReplied: {},
I20150404-13:23:03.228(-5)? isInitializing: true,
I20150404-13:23:03.228(-5)? openCalled: true,
I20150404-13:23:03.228(-5)? commands: [],
I20150404-13:23:03.228(-5)? logger: [Object],
I20150404-13:23:03.228(-5)? tag: 1428171705676,
I20150404-13:23:03.229(-5)? eventHandlers: [Object],
I20150404-13:23:03.229(-5)? serializeFunctions: false,
I20150404-13:23:03.229(-5)? raw: false,
I20150404-13:23:03.229(-5)? recordQueryStats: false,
I20150404-13:23:03.229(-5)? retryMiliSeconds: 1000,
I20150404-13:23:03.229(-5)? numberOfRetries: 60,
I20150404-13:23:03.230(-5)? readPreference: [Object] },
I20150404-13:23:03.230(-5)? _primary: '127.0.0.1:3001',
I20150404-13:23:03.230(-5)? _oplogHandle:
I20150404-13:23:03.230(-5)? { _oplogUrl: 'mongodb://127.0.0.1:3001/local',
I20150404-13:23:03.230(-5)? _dbName: 'meteor',
I20150404-13:23:03.231(-5)? _oplogLastEntryConnection: [Object],
I20150404-13:23:03.231(-5)? _oplogTailConnection: [Object],
I20150404-13:23:03.231(-5)? _stopped: false,
I20150404-13:23:03.231(-5)? _tailHandle: [Object],
I20150404-13:23:03.231(-5)? _readyFuture: [Object],
I20150404-13:23:03.231(-5)? _crossbar: [Object],
I20150404-13:23:03.232(-5)? _baseOplogSelector: [Object],
I20150404-13:23:03.232(-5)? _catchingUpFutures: [],
I20150404-13:23:03.232(-5)? _lastProcessedTS: [Object],
I20150404-13:23:03.232(-5)? _onSkippedEntriesHook: [Object],
I20150404-13:23:03.232(-5)? _entryQueue: [Object],
I20150404-13:23:03.232(-5)? _workerActive: false },
I20150404-13:23:03.233(-5)? _docFetcher: { _mongoConnection: [Circular], _callbacksForCacheKey: {} } },
I20150404-13:23:03.233(-5)? _cursorDescription:
I20150404-13:23:03.233(-5)? { collectionName: 'users',
I20150404-13:23:03.233(-5)? selector: {},
I20150404-13:23:03.234(-5)? options: { transform: null } },
I20150404-13:23:03.234(-5)? _synchronousCursor: null }
I20150404-13:23:03.234(-5)? ..
Note:
If I write the query with findOne
instead, the console just logs undefined