-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Added npm start script to package.json * ACTUALLY added npm start script to package.json * Added xunit output file * test script in package.json * New nagivation tests * New tests, switched to headless mode, xUnit reporter file * changed test script to dev env * spelling error in reporter * Switched to junit reporter, changed testdata to automation user and email, updated tests with new testdata
- Loading branch information
Showing
9 changed files
with
1,298 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/Screenshots | ||
**/junit.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { t } from 'testcafe'; | ||
import { waitForReact } from 'testcafe-react-selectors'; | ||
import DesignerPage from '../page-objects/designerPage'; | ||
import CommonPage from '../page-objects/common'; | ||
import TestData from '../TestData'; | ||
import App from '../app'; | ||
import LoginPage from '../page-objects/loginPage'; | ||
|
||
let app = new App(); | ||
let common = new CommonPage(); | ||
let loginPage = new LoginPage(); | ||
let designerPage = new DesignerPage(); | ||
const testUser = new TestData('AutoTest', '[email protected]', 'test123', 'basic'); | ||
|
||
fixture('Navigating the Service designer') | ||
.page(app.baseUrl) | ||
.before(async () => { | ||
}) | ||
.beforeEach(async () => { | ||
await common.login(testUser.userEmail, testUser.password, loginPage); | ||
await waitForReact(); | ||
//app.before(); | ||
}) | ||
.after(async () => { | ||
//await app.after(); | ||
}) | ||
|
||
test('Om tab navigation', async () => { | ||
await t | ||
.navigateTo(app.baseUrl + 'designer/AutoTest/testcafe01#/aboutservice') //navigate to the designer on test user repo | ||
.click(designerPage.omNavigationTab) | ||
.hover(designerPage.leftDrawerMenu) | ||
.expect(designerPage.omLeftMenuItems[0].visible).ok() | ||
.expect(designerPage.omLeftMenuItems[1].visible).ok() | ||
.expect(designerPage.omLeftMenuItems[2].visible).ok() | ||
.expect(designerPage.omLeftMenuItems[3].visible).ok() | ||
.expect(designerPage.omLeftMenuItems[4].visible).ok() | ||
.expect(designerPage.omLeftMenuItems[5].visible).ok() | ||
}); | ||
|
||
test('Lage tab navigation', async () => { | ||
await t | ||
.navigateTo(app.baseUrl + 'designer/AutoTest/testcafe01#/aboutservice') | ||
.click(designerPage.lageNavigationTab) | ||
.hover(designerPage.leftDrawerMenu) | ||
.expect(designerPage.lageLeftMenuItems[0].visible).ok() | ||
.expect(designerPage.lageLeftMenuItems[1].visible).ok() | ||
.expect(designerPage.lageLeftMenuItems[2].visible).ok() | ||
}); | ||
|
||
test('Språk tab navigation', async () => { | ||
await t | ||
.navigateTo(app.baseUrl + 'designer/AutoTest/testcafe01#/aboutservice') | ||
.click(designerPage.spraakNavigationTab) | ||
.hover(designerPage.leftDrawerMenu) | ||
.expect(designerPage.spraakLeftMenuItems[0].visible).ok() | ||
.expect(designerPage.spraakLeftMenuItems[1].visible).ok() | ||
}); | ||
|
||
test('Teste tab navigation', async () => { | ||
await t | ||
.navigateTo(app.baseUrl + 'designer/AutoTest/testcafe01#/aboutservice') | ||
.click(designerPage.testeNavigationTab) | ||
.hover(designerPage.leftDrawerMenu) | ||
.expect(designerPage.testeLeftMenuItems[0].visible).ok() | ||
}); | ||
|
||
test('Publisere tab navigation', async () => { | ||
await t | ||
.navigateTo(app.baseUrl + 'designer/AutoTest/testcafe01#/aboutservice') | ||
.click(designerPage.publisereNavigationTab) | ||
.hover(designerPage.leftDrawerMenu) | ||
.expect(designerPage.publisereLeftMenuItems[0].visible).ok() | ||
.expect(designerPage.publisereLeftMenuItems[1].visible).ok() | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
const createTestCafe = require('testcafe'); | ||
const fs = require('fs'); | ||
let testcafe = null; | ||
|
||
createTestCafe() | ||
.then(tc => { | ||
testcafe = tc; | ||
const runner = testcafe.createRunner(); | ||
const stream = fs.createWriteStream('junit.xml'); | ||
|
||
return runner | ||
.browsers(['chrome']) | ||
.browsers(['chrome:headless']) | ||
.concurrency(1) | ||
//.speed(0.75) | ||
.screenshots('./screenshots', { takeOnFails: false }) | ||
.reporter('spec') | ||
.src(['./repository_tests/login_create_new_repo.js']) | ||
.screenshots('./screenshots', { takeOnFails: true }) | ||
.reporter('junit', stream) | ||
.src(['./designer_tests/navigation-tests.js']) | ||
.run({ | ||
skipJsErrors: true, | ||
quarantineMode: false, | ||
selectorTimeout: 2000, | ||
assertionTimeout: 1000, | ||
pageLoadTimeout: 1000, | ||
selectorTimeout: 5000, | ||
assertionTimeout: 5000, | ||
pageLoadTimeout: 5000, | ||
speed: 1, | ||
debugOnFail: true, | ||
stopOnFirstFail: true | ||
stopOnFirstFail: false | ||
}) | ||
.then(failedCount => { | ||
console.log('Total tests failed ' + failedCount); | ||
stream.end(); | ||
}) | ||
}) | ||
.then(failedCount => { | ||
console.log('Total tests failed: ' + failedCount); | ||
.then(() => { | ||
testcafe.close(); | ||
}); |
Oops, something went wrong.