Yoji SHIDARA
null+****@clear*****
Thu Aug 30 17:52:55 JST 2012
Yoji SHIDARA 2012-08-30 17:52:55 +0900 (Thu, 30 Aug 2012) New Revision: e2378b2a82b6ddcb5ca485dcfe45a42d1849ebf6 https://github.com/groonga/gcs/commit/e2378b2a82b6ddcb5ca485dcfe45a42d1849ebf6 Log: Add a test for simple querying Modified files: test_casper/casper-runner.js test_casper/test/dashboard.js Modified: test_casper/casper-runner.js (+8 -1) =================================================================== --- test_casper/casper-runner.js 2012-08-30 16:45:50 +0900 (ed93524) +++ test_casper/casper-runner.js 2012-08-30 17:52:55 +0900 (c99f85d) @@ -23,7 +23,14 @@ function casper(options, callback) { }); } -var server = utils.setupServer(); +var temporaryDatabase = utils.createTemporaryDatabase(); +var context = temporaryDatabase.get(); +var server = utils.setupServer(context); + +utils.loadDumpFile(context, __dirname + '/../test/fixture/companies/ddl.grn'); +utils.loadDumpFile(context, __dirname + '/../test/fixture/companies/configurations.grn'); +utils.loadDumpFile(context, __dirname + '/../test/fixture/companies/data.grn'); + var options = [ 'test', __dirname + '/test', Modified: test_casper/test/dashboard.js (+11 -0) =================================================================== --- test_casper/test/dashboard.js 2012-08-30 16:45:50 +0900 (45a01ed) +++ test_casper/test/dashboard.js 2012-08-30 17:52:55 +0900 (47494b6) @@ -5,6 +5,17 @@ casper.start(dashboardUrl, function() { this.test.assertTitle('Groonga CloudSearch'); }); +casper.thenEvaluate(function() { + document.querySelector('input[name="query"]').setAttribute('value', 'tokyo'); + document.querySelector('input[type="submit"]').click(); +}); + +casper.waitForSelector('#results table', function() { + this.test.assertEvalEquals(function() { + return __utils__.findAll('.id-row').length; + }, 3, 'Query "tokyo" returns 3 hit records'); +}); + casper.run(function() { this.test.renderResults(true); }); -------------- next part -------------- HTML����������������������������... 下載