diff --git a/client/test/helpers/helpers.js b/client/test/helpers/helpers.js index 56372b30..8d7052e0 100644 --- a/client/test/helpers/helpers.js +++ b/client/test/helpers/helpers.js @@ -1,11 +1,13 @@ const LoginSteps = require('../specs/Login/steps/login_pa'); const credentials = require('../specs/credentials'); +const wait = require('../helpers/waiters'); class HelpClass { loginWithDefaultUser() { browser.maximizeWindow(); browser.url('https://stage.depothub.xyz/login'); LoginSteps.submitLoginForm(credentials.login.email, credentials.login.password); + wait.forSpinner(); } } diff --git a/client/test/specs/DropdownMenu/steps/menu_pa.js b/client/test/specs/DropdownMenu/steps/menu_pa.js index a63b3fa1..286d1a10 100644 --- a/client/test/specs/DropdownMenu/steps/menu_pa.js +++ b/client/test/specs/DropdownMenu/steps/menu_pa.js @@ -12,7 +12,7 @@ class MenuSteps { } navigateToNewOrganization() { this.moveToMenu(); - MenuPage.newRepositoryLink.waitForDisplayed(2000); + MenuPage.newOrganizationLink.waitForDisplayed(2000); MenuPage.newOrganizationLink.click(); } } diff --git a/client/test/specs/Repository/page/repository_po.js b/client/test/specs/Repository/page/repository_po.js index 6d900ebf..9203d2d8 100644 --- a/client/test/specs/Repository/page/repository_po.js +++ b/client/test/specs/Repository/page/repository_po.js @@ -27,13 +27,13 @@ class RepoPage { return $$('span.styles_repoPath__3Ye3J a')[1]; } get repoSettings() { - return $$('div.false a')[1]; + return $$('div.false a')[3]; } get deleteBtn() { return $$('button[type=button]')[1]; } get createNewFileBtn() { - return $$('div.ui.buttons button')[0]; + return $('div.styles_repoActions__3UqWR button'); } get newFileNameInput() { return $('div.styles_fileNameInput__1baIY input'); @@ -45,7 +45,7 @@ class RepoPage { return $('div button[type="submit"]'); } get createdFileName() { - return $$('tbody tr td a')[6]; + return $$('tbody tr td a.styles_link__2E3TI')[6]; } } diff --git a/client/test/specs/Repository/repository_test.js b/client/test/specs/Repository/repository_test.js index f7751a7a..2f248230 100644 --- a/client/test/specs/Repository/repository_test.js +++ b/client/test/specs/Repository/repository_test.js @@ -9,44 +9,39 @@ const wait = require('../../helpers/waiters'); describe('Repositories ', () => { beforeEach(() => { help.loginWithDefaultUser(); - wait.forSpinner(); }); afterEach(() => { + repoSteps.navigateToRepoSettings(); + repoSteps.deleteRepo(); browser.reloadSession(); }); it('should create repository', () => { menuSteps.navigateToNewRepository(); wait.forSpinner(); - repoSteps.enterRepoName(credentials.repo.repoName); + repoSteps.enterRepoName(credentials.repo.repoName1); repoSteps.enterDescription(credentials.repo.repoDescription); repoSteps.selectReadme(); repoSteps.addGitignore(); repoSteps.addLicense(); - repoSteps.submitCreateRepoBtn(); - assert.strictEqual(credentials.repo.repoName, repoPage.createdRepoName.getText()); - //postconditions - repoSteps.navigateToRepoSettings(); - repoSteps.deleteRepo(); + repoSteps.submitCreateRepoForm(); + assert.strictEqual(credentials.repo.repoName1, repoPage.createdRepoName.getText()); }); it('should create new file in repository', () => { menuSteps.navigateToNewRepository(); wait.forSpinner(); - repoSteps.enterRepoName(credentials.repo.repoName); + repoSteps.enterRepoName(credentials.repo.repoName2); repoSteps.enterDescription(credentials.repo.repoDescription); repoSteps.selectReadme(); repoSteps.addGitignore(); repoSteps.addLicense(); - repoSteps.submitCreateRepoBtn(); + repoSteps.submitCreateRepoForm(); repoSteps.createNewFileBtn(); repoSteps.enterNewFileName(credentials.newFileName); repoSteps.enterCommitMessage(credentials.commitMessage); repoSteps.submitCommit(); - assert.strictEqual(credentials.newFileName, repoPage.createdFileName.getText()); - //postconditions - repoSteps.navigateToRepoSettings(); - repoSteps.deleteRepo(); + assert.strictEqual(credentials.newFileName2, repoSteps.getFileName()); }); }); diff --git a/client/test/specs/Repository/steps/repository_pa.js b/client/test/specs/Repository/steps/repository_pa.js index a200cffb..e03035df 100644 --- a/client/test/specs/Repository/steps/repository_pa.js +++ b/client/test/specs/Repository/steps/repository_pa.js @@ -28,7 +28,7 @@ class RepoSteps { repoPage.selectLicense.click(); } - submitCreateRepoBtn() { + submitCreateRepoForm() { repoPage.createRepoBtn.click(); browser.pause(500); } @@ -55,13 +55,19 @@ class RepoSteps { enterCommitMessage(commitMessage) { repoPage.commitMessageInput.clearValue(); + repoPage.commitMessageInput.scrollIntoView(); repoPage.commitMessageInput.setValue(commitMessage); } submitCommit() { repoPage.commitFileBtn.scrollIntoView(); + repoPage.commitFileBtn.waitForDisplayed(2000); repoPage.commitFileBtn.click(); - browser.pause(500); + browser.pause(750); + } + getFileName() { + browser.pause(750); + repoPage.createdFileName.getText(); } } diff --git a/client/test/specs/UserSettings/steps/user_settings_pa.js b/client/test/specs/UserSettings/steps/user_settings_pa.js index 4dfca2d6..15673fc3 100644 --- a/client/test/specs/UserSettings/steps/user_settings_pa.js +++ b/client/test/specs/UserSettings/steps/user_settings_pa.js @@ -1,8 +1,16 @@ const SettingsPages = require('../pages/user_settings_po'); class SettingsSteps { - enterName(name) { + fillUpUserProfile(info) { SettingsPages.nameInput.waitForDisplayed(2000); + this.enterName(info.profileSettings.name); + this.enterBio(info.profileSettings.bio); + this.enterUrl(info.profileSettings.url); + this.enterCompany(info.profileSettings.company); + this.enterLocation(info.profileSettings.location); + } + + enterName(name) { SettingsPages.nameInput.clearValue(); SettingsPages.nameInput.setValue(name); } @@ -27,7 +35,8 @@ class SettingsSteps { SettingsPages.locationInput.setValue(location); } - updateProfileBtn() { + updateProfile() { + SettingsPages.updateProfileButton.waitForDisplayed(2000); SettingsPages.updateProfileButton.click(); } diff --git a/client/test/specs/UserSettings/user_settings_test.js b/client/test/specs/UserSettings/user_settings_test.js index 374d1735..82c16a8e 100644 --- a/client/test/specs/UserSettings/user_settings_test.js +++ b/client/test/specs/UserSettings/user_settings_test.js @@ -15,12 +15,8 @@ describe('Settings', () => { it('should change user public information', () => { profileSteps.navigateToProfileSettings(); - profileSteps.enterName(credentials.profileSettings.name); - profileSteps.enterBio(credentials.profileSettings.bio); - profileSteps.enterUrl(credentials.profileSettings.url); - profileSteps.enterCompany(credentials.profileSettings.company); - profileSteps.enterLocation(credentials.profileSettings.location); - profileSteps.updateProfileBtn(); + profileSteps.fillUpUserProfile(credentials); + profileSteps.updateProfile(); profileSteps.navigateToYourProfile(); assert.strictEqual(credentials.profileSettings.name, profileObj.updatedName.getText()); diff --git a/client/test/specs/credentials.json b/client/test/specs/credentials.json index 2519f900..0d80a721 100644 --- a/client/test/specs/credentials.json +++ b/client/test/specs/credentials.json @@ -4,7 +4,8 @@ "password": "Q!w2e3r4t5" }, "repo": { - "repoName": "RepoTest123", + "repoName1": "RepoTest1", + "repoName2": "RepoTest2", "repoDescription": "test" },