-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Петрова Ксения #1
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,15 @@ | |
"version": "0.0.1", | ||
"description": "Selenium", | ||
"scripts": { | ||
"test": "wdio wdio.conf.js" | ||
"test": "wdio wdio.conf.js", | ||
"selenium:install": "selenium-standalone install", | ||
"selenium:start": "selenium-standalone start" | ||
}, | ||
"author": "Sergey Zhigalov <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"moment": "^2.18.1", | ||
"selenium-standalone": "^6.4.1", | ||
"wdio-mocha-framework": "0.5.10", | ||
"wdio-sauce-service": "0.4.0", | ||
"wdio-spec-reporter": "0.1.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,49 @@ | ||
const assert = require('assert'); | ||
const moment = require ('moment'); | ||
|
||
describe('Mongomart', () => { | ||
it('should ...', () => { | ||
browser.url('http://urfu-2016-testing.herokuapp.com/'); | ||
}); | ||
it('should find one product by query "cup"', () => { | ||
const data = browser | ||
.url('/') | ||
.addValue('input[name="query"]','cup') | ||
.click('button[type="submit"]') | ||
.elements('.row img'); | ||
|
||
assert.equal(data.value.length, 1); | ||
}); | ||
it('should be right navigation', () => { | ||
browser.url('/item/11'); | ||
|
||
const actualTopLevel = browser.getText('.breadcrumb li:nth-child(1) a'); | ||
const actualCategory = browser.getText('.breadcrumb li:nth-child(2) a'); | ||
const actualItem = browser.getText('.breadcrumb li:nth-child(3)'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Я бы ещё проверил что на этом крошки заканчиваются |
||
const actualTopLevelHref = browser.getAttribute('.breadcrumb li:nth-child(1) a', 'href'); | ||
const actualCategoryHref = browser.getAttribute('.breadcrumb li:nth-child(2) a', 'href'); | ||
|
||
assert.equal(actualTopLevel, 'Home'); | ||
assert.equal(actualCategory, 'Books'); | ||
assert.equal(actualItem, 'MongoDB The Definitive Guide'); | ||
assert.equal(actualTopLevelHref, 'http://urfu-2016-testing.herokuapp.com/'); | ||
assert.equal(actualCategoryHref, 'http://urfu-2016-testing.herokuapp.com/?category=Books'); | ||
}); | ||
it('should be same category when click on category link in navigation', () => { | ||
browser.url('/item/11'); | ||
|
||
const expectedCategory = browser.getText('.breadcrumb li:nth-child(2) a'); | ||
|
||
browser.click('.breadcrumb li:nth-child(2) a'); | ||
|
||
const actualCategory = browser.getText('.breadcrumb li:nth-child(2)'); | ||
|
||
assert.equal(actualCategory, expectedCategory); | ||
}); | ||
it('should be right date format', () => { | ||
browser.url('/item/11'); | ||
|
||
const actualDate = browser.getText('.media-heading small')[0]; | ||
|
||
assert(moment(actualDate, 'MMMM Do YYYY, h:m:s a', true).isValid()); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. В этом тесте нужно добавить новый комментарий и проверить что время его добавления нужное. |
||
}); | ||
|
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
exports.config = { | ||
host: 'hub-cloud.browserstack.com', | ||
port: 4444, | ||
path: '/wd/hub', | ||
user: 'xeniapeter1', | ||
key: 'o7gL4AgWtLzsHnqGekue', | ||
// | ||
// ================== | ||
// Specify Test Files | ||
// ================== | ||
// Define which test specs should run. The pattern is relative to the directory | ||
// from which `wdio` was called. Notice that, if you are calling `wdio` from an | ||
// NPM script (see https://docs.npmjs.com/cli/run-script) then the current working | ||
// directory is where your package.json resides, so `wdio` will be called from there. | ||
// | ||
specs: [ | ||
'tests/**' | ||
], | ||
|
||
|
||
// If you have trouble getting all important capabilities together, check out the | ||
// Sauce Labs platform configurator - a great tool to configure your capabilities: | ||
// https://docs.saucelabs.com/reference/platforms-configurator | ||
// | ||
capabilities: [ | ||
{ | ||
browserName: 'chrome' | ||
}, | ||
{ | ||
browserName: 'firefox', | ||
} | ||
], | ||
|
||
screenshotPath: 'shots', | ||
|
||
baseUrl: 'http://urfu-2016-testing.herokuapp.com/', | ||
|
||
waitforTimeout: 1000, | ||
|
||
framework: 'mocha' | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хлебные крошки есть не только на странице с продуктом: корзина, главная и т.д.
Их тоже хорошо бы проверить