Skip to content

Commit

Permalink
screenobject(update): update tests and config file
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Oct 19, 2023
1 parent 427caca commit 6989031
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions config/wdio.windows.app.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ export const config: WebdriverIO.Config = {
onPrepare: async function() {
// Declare constants for folder locations
const cacheFolder = homedir() + "\\.uplink\\.user"
const savedFile = join(process.cwd(), "\\tests\\fixtures\\saved.jpg")
const sourceReusableData = join(process.cwd(), "\\tests\\fixtures\\users\\FriendsTestUser")
const targetReusableData = join(process.cwd(), "\\tests\\fixtures\\users\\windows\\FriendsTestUser")
const allureResultsFolder = join(process.cwd(), "\\allure-results");
const testReportFolder = join(process.cwd(), "\\test-report");
const testResultsFolder = join(process.cwd(), "\\test-results");
try {
await rmSync(allureResultsFolder, { recursive: true, force: true });
await rmSync(savedFile, { recursive: true, force: true });
await rmSync(testReportFolder, { recursive: true, force: true });
await rmSync(testResultsFolder, { recursive: true, force: true });
console.log("Deleted Artifacts Folders Successfully!");
Expand Down
2 changes: 2 additions & 0 deletions config/wdio.windows.ci.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ export const config: WebdriverIO.Config = {
onPrepare: async function() {
// Declare constants for folder locations
const cacheFolder = homedir() + "\\.uplink\\.user"
const savedFile = join(process.cwd(), "\\tests\\fixtures\\saved.jpg")
const sourceReusableData = join(process.cwd(), "\\tests\\fixtures\\users\\FriendsTestUser")
const targetReusableData = join(process.cwd(), "\\tests\\fixtures\\users\\windows\\FriendsTestUser")
const allureResultsFolder = join(process.cwd(), "\\allure-results");
const testReportFolder = join(process.cwd(), "\\test-report");
const testResultsFolder = join(process.cwd(), "\\test-results");
try {
await rmSync(allureResultsFolder, { recursive: true, force: true });
await rmSync(savedFile, { recursive: true, force: true });
await rmSync(testReportFolder, { recursive: true, force: true });
await rmSync(testResultsFolder, { recursive: true, force: true });
console.log("Deleted Artifacts Folders Successfully!");
Expand Down
16 changes: 8 additions & 8 deletions tests/specs/05-settings-profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,8 @@ export default async function settingsProfile() {
await cropProfileFirstUser.cropImageTopbarButtonCancel.waitForExist();
await cropProfileFirstUser.cropImageTopbarButtonConfirm.waitForExist();

// Validate helper text displayed on top of modal is correct
const topbarLabelText = await cropProfileFirstUser.cropImageTopbarLabelText;
await expect(topbarLabelText).toHaveTextContaining(
"PLEASE SELECT THE AREA YOU WANT TO CROP"
);
// Validate helper text is displayed on top of modal
await cropProfileFirstUser.cropImageTopbarLabel.waitForExist();

// Validate default value shown for zoom slider is 1
const rangeValueText = await cropProfileFirstUser.cropImageRangeValueText;
Expand All @@ -123,15 +120,17 @@ export default async function settingsProfile() {
// Validate Crop Tool Modal is displayed
await cropProfileFirstUser.validateCropToolModalIsShown();

// Click three times on increase button, then one time on decrease button and confirm
// Click three times on increase button, then one time on decrease button
await cropProfileFirstUser.clickMultipleTimesIncreaseButton(3);
await cropProfileFirstUser.clickOnDecreaseRangeButton();
await cropProfileFirstUser.clickOnConfirmButton();

// Validate final value shown for zoom slider is 1
const rangeValueText = await cropProfileFirstUser.cropImageRangeValueText;
await expect(rangeValueText).toHaveTextContaining("1.2");

// Click on confirm button to save
await cropProfileFirstUser.clickOnConfirmButton();

// Validate new profile picture is displayed
await settingsProfileFirstUser.validateProfilePictureIsShown();
});
Expand Down Expand Up @@ -168,7 +167,8 @@ export default async function settingsProfile() {
// Validate Crop Tool Modal is displayed
await cropProfileFirstUser.validateCropToolModalIsShown();

// Do not change the size of picture and just confirm on crop modal
// Change the size of picture and click on confirm button to save
await cropProfileFirstUser.clickOnIncreaseRangeButton();
await cropProfileFirstUser.clickOnConfirmButton();

// Validate new profile picture is displayed
Expand Down

0 comments on commit 6989031

Please sign in to comment.