Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"author": "Sergey Zhigalov <zhigalov@yandex-team.ru>",
"license": "MIT",
"devDependencies": {
"wdio-mocha-framework": "0.5.10",
"wdio-sauce-service": "0.4.0",
"wdio-spec-reporter": "0.1.0",
"webdriverio": "4.8.0"
"selenium-standalone": "^6.4.1",
"wdio-mocha-framework": "^0.5.10",
"wdio-sauce-service": "^0.4.0",
"wdio-spec-reporter": "^0.1.0",
"webdriverio": "^4.8.0",
"moment": "^2.18.1"
}
}
51 changes: 47 additions & 4 deletions tests/mongomart-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
describe('Mongomart', () => {
it('should ...', () => {
browser.url('http://urfu-2016-testing.herokuapp.com/');
const assert = require("assert");
const moment = require("moment");

describe("Mongomart", () => {
describe('Product search', () => {
before(() => {
browser
.url('/');
});

it('should show 0 product for ""', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for "" -> for empty string
А то я сначала подумал что это какой-то шаблонный тест

В интеграционных тестах принято проверять успешные сценарии
Проверь что по заданному слову будут искаться товары

browser
.setValue("input[name='query']", "")
.click('button[type="submit"]');
assert.equal(browser.getText('i'), '0 Products');

});
});
});

describe('Comments', () => {

it('should have right datetime format', () => {
browser
.url('/item/12')
.click(`input[value="5"]`)
.click('form:nth-child(2) button[type="submit"]');
let allComments = browser.getText('div.col-lg-12>div');
const date = browser.getText('.media-heading small')[allComments.length - 1];

assert(moment(date, 'MMMM Do YYYY, h:m:s a').isValid());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В этом тесте не хватает проверки на время

});
});

describe('Bread crumbs', () => {

it('should show right bread crumbs for "Leaf Sticker"', () => {
browser
.url('/')
.click('a[href="/?category=Stickers"]')
.click('a[href="/item/12"');

let crumbs = browser.getText('ol li');
assert.equal(crumbs[0], 'Home');
assert.equal(crumbs[1], 'Stickers');
assert.equal(crumbs[2], 'Leaf Sticker');
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хлебные крошки есть на нескольких страницах: главная, поиск, корзина и т.д.
Надо проверить все

});
});
62 changes: 62 additions & 0 deletions wdio.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
exports.config = {

//
// =================
// Service Providers
// =================
// WebdriverIO supports Sauce Labs, Browserstack, and Testing Bot (other cloud providers
// should work too though). These services define specific user and key (or access key)
// values you need to put in here in order to connect to these services.
//
user: "georgy",
key: "2d20cd62-cd70-4418-9d23-5e112520341c",

specs: [
'./tests/*.js'
],

exclude: [
],

maxInstances: 10,

capabilities: [
{
browserName: 'firefox',
name: 'firefox mongomart tests'
},
{
browserName: 'chrome',
name: 'chrome mongomart tests'
}],

sync: true,

logLevel: 'command',

coloredLogs: true,

bail: 0,

screenshotPath: './errorShots/',

baseUrl: 'http://urfu-2016-testing.herokuapp.com',

waitforTimeout: 10000,

connectionRetryTimeout: 90000,

connectionRetryCount: 3,

services: ['sauce'],

framework: 'mocha',

reporters: ['spec'],


mochaOpts: {
ui: 'bdd',
timeout: 30000
}
}