private void TestTriadicAndTetradicColors(IColorsLabController colorsLab) { Slide actualSlide = PpOperations.SelectSlide(OriginalSlideNo); // Eyedrop the outline color shape Shape shape = PpOperations.SelectShape(LineColorShape)[1]; Point startPt = colorsLab.GetEyeDropperButtonLocation(); Point endPt = GetShapeCenterPoint(shape); DragAndDrop(startPt, endPt); // Apply triadicRectThree as Fill colorsLab.ClickTriadicRect(3); startPt = colorsLab.GetApplyFillButtonLocation(); endPt = colorsLab.GetMainColorRectangleLocation(); PpOperations.SelectShape(TargetShape); DragAndDrop(startPt, endPt); // Apply tetradicRectThree as Line colorsLab.ClickTetradicRect(3); startPt = colorsLab.GetApplyLineButtonLocation(); endPt = colorsLab.GetMainColorRectangleLocation(); PpOperations.SelectShape(TargetShape); DragAndDrop(startPt, endPt); Slide expSlide = PpOperations.SelectSlide(TriadicAndTetradicChangeSlideNo); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void TestMonochromeMatchingColors(IColorsLabController colorsLab) { Slide actualSlide = PpOperations.SelectSlide(OriginalSlideNo); // Apply monochromeRectOne as Line colorsLab.ClickMonochromeRect(1); Point startPt = colorsLab.GetApplyLineButtonLocation(); Point endPt = colorsLab.GetMainColorRectangleLocation(); PpOperations.SelectShape(TargetShape); DragAndDrop(startPt, endPt); // Apply monochromeRectTwo as Text colorsLab.ClickMonochromeRect(2); startPt = colorsLab.GetApplyTextButtonLocation(); endPt = colorsLab.GetMainColorRectangleLocation(); PpOperations.SelectShape(TargetShape); DragAndDrop(startPt, endPt); // Apply monochromeRectSix as Fill colorsLab.ClickMonochromeRect(6); startPt = colorsLab.GetApplyFillButtonLocation(); endPt = colorsLab.GetMainColorRectangleLocation(); PpOperations.SelectShape(TargetShape); DragAndDrop(startPt, endPt); Slide expSlide = PpOperations.SelectSlide(MonochromeColorChangeSlideNo); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void TestAnalogousAndComplementaryColors(IColorsLabController colorsLab) { Slide actualSlide = PpOperations.SelectSlide(OriginalSlideNo); // Eyedrop the font color shape Shape shape = PpOperations.SelectShape(FontColorShape)[1]; Point startPt = colorsLab.GetEyeDropperButtonLocation(); Point endPt = GetShapeCenterPoint(shape); DragAndDrop(startPt, endPt); // Apply analagousRectOne as Text colorsLab.ClickAnalogousRect(1); startPt = colorsLab.GetApplyTextButtonLocation(); endPt = colorsLab.GetMainColorRectangleLocation(); PpOperations.SelectShape(TargetShape); DragAndDrop(startPt, endPt); // Apply complementaryRectThree as Line colorsLab.ClickComplementaryRect(3); startPt = colorsLab.GetApplyLineButtonLocation(); endPt = colorsLab.GetMainColorRectangleLocation(); PpOperations.SelectShape(TargetShape); DragAndDrop(startPt, endPt); Slide expSlide = PpOperations.SelectSlide(AnalogousAndComplementaryChangeSlideNo); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void TestColorInfoDialog(IColorsLabController colorsLab) { IColorsLabMoreInfoDialog infoDialog = null; try { infoDialog = colorsLab.ShowMoreColorInfo(colorsLab.GetMonoPanel1().BackColor); // rgb text is like "RGB: 163, 192, 242" var rgbColor = infoDialog.GetRgbText().Substring(5).Split(','); var r = Int32.Parse(rgbColor[0].Trim()); var g = Int32.Parse(rgbColor[1].Trim()); var b = Int32.Parse(rgbColor[2].Trim()); // rgb values can have errors within threshold 2 Assert.IsTrue(Math.Abs(r - 163) <= 2); Assert.IsTrue(Math.Abs(g - 192) <= 2); Assert.IsTrue(Math.Abs(b - 242) <= 2); } finally { if (infoDialog != null) { infoDialog.TearDown(); } } }
private void TestApplyingColors(IColorsLabController colorsLab) { var actualSlide = PpOperations.SelectSlide(3); var fontColorShape = PpOperations.SelectShape("fontColor")[1]; var lineColorShape = PpOperations.SelectShape("lineColor")[1]; var fillColorShape = PpOperations.SelectShape("fillColor")[1]; PpOperations.SelectShape("selectMe"); var dropletPanel = colorsLab.GetDropletPanel(); // get main color from fontColorShape // then apply main color to font color of target shape ApplyColor(dropletPanel, fontColorShape); ApplyColor(colorsLab.GetFontColorButton(), dropletPanel); // directly apply font color by fontColorShape's fill color ApplyColor(colorsLab.GetLineColorButton(), lineColorShape); // get main color from fillColorShape // then apply main color to fill color of target shape ApplyColor(dropletPanel, fillColorShape); ApplyColor(colorsLab.GetFillCollorButton(), dropletPanel); var expSlide = PpOperations.SelectSlide(4); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void TestRecentColors(IColorsLabController colorsLab) { // After all the calls in the earlier tests, recent colors panel should be populated List <Color> currentRecentPanel = colorsLab.GetCurrentRecentPanel(); AssertEqual(RecentColorsAfterFT, currentRecentPanel); }
private void TestRecommendedColors(IColorsLabController colorsLab) { var actualSlide = PpOperations.SelectSlide(3); PpOperations.SelectShape("selectMe"); // mono panel7's color will become main color now Click(colorsLab.GetMonoPanel7()); ApplyColor(colorsLab.GetFillCollorButton(), colorsLab.GetDropletPanel()); var expSlide = PpOperations.SelectSlide(5); SlideUtil.IsSameLooking(expSlide, actualSlide); }
public void FT_ColorsLabTest() { // if not maximized, some elements in Colors pane may not be seen PpOperations.MaximizeWindow(); IColorsLabController colorsLab = PplFeatures.ColorsLab; colorsLab.OpenPane(); TestApplyingColors(colorsLab); TestRecommendedColors(colorsLab); TestFavoriteColors(colorsLab); TestColorInfoDialog(colorsLab); }
private void TestRecommendedColors(IColorsLabController colorsLab) { var actualSlide = PpOperations.SelectSlide(3); PpOperations.SelectShape("selectMe"); // mono panel7's color will become main color now Click(colorsLab.GetMonoPanel7()); ApplyColor(colorsLab.GetFillCollorButton(), colorsLab.GetDropletPanel()); var expSlide = PpOperations.SelectSlide(5); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void TestApplyFillColor(IColorsLabController colorsLab) { Slide actualSlide = PpOperations.SelectSlide(OriginalSlideNo); Shape shape = PpOperations.SelectShape(FillColorShape)[1]; Point startPt = colorsLab.GetApplyFillButtonLocation(); Point endPt = GetShapeCenterPoint(shape); PpOperations.SelectShape(TargetShape); DragAndDrop(startPt, endPt); Slide expSlide = PpOperations.SelectSlide(FillColorChangeSlideNo); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void TestBrightnessAndSaturationSlider(IColorsLabController colorsLab) { Slide actualSlide = PpOperations.SelectSlide(OriginalSlideNo); colorsLab.SlideBrightnessSlider(120); colorsLab.SlideSaturationSlider(240); Point startPt = colorsLab.GetApplyLineButtonLocation(); Point endPt = colorsLab.GetMainColorRectangleLocation(); PpOperations.SelectShape(TargetShape); DragAndDrop(startPt, endPt); Slide expSlide = PpOperations.SelectSlide(BrightnessAndSaturationChangeSlideNo); SlideUtil.IsSameLooking(expSlide, actualSlide); }
private void TestFavoriteColors(IColorsLabController colorsLab) { // Clear the favorite colors panel colorsLab.ClearFavoriteColors(); List <Color> currentFavoritePanel = colorsLab.GetCurrentFavoritePanel(); AssertEqual(AllWhiteColorList, currentFavoritePanel); // Load the test case colorsLab.LoadFavoriteColors( PathUtil.GetDocTestPresentationPath("ColorsLab\\FavoriteColorsTest.thm")); currentFavoritePanel = colorsLab.GetCurrentFavoritePanel(); AssertEqual(DefaultTestColors, currentFavoritePanel); // Clear panel colorsLab.ClearFavoriteColors(); currentFavoritePanel = colorsLab.GetCurrentFavoritePanel(); AssertEqual(AllWhiteColorList, currentFavoritePanel); }
private void TestColorInfoDialog(IColorsLabController colorsLab) { IColorsLabMoreInfoDialog infoDialog = null; try { infoDialog = colorsLab.ShowMoreColorInfo(colorsLab.GetMonoPanel1().BackColor); // rgb text is like "RGB: 163, 192, 242" var rgbColor = infoDialog.GetRgbText().Substring(5).Split(','); var r = Int32.Parse(rgbColor[0].Trim()); var g = Int32.Parse(rgbColor[1].Trim()); var b = Int32.Parse(rgbColor[2].Trim()); // rgb values can have errors within threshold 2 Assert.IsTrue(Math.Abs(r - 163) <= 2); Assert.IsTrue(Math.Abs(g - 192) <= 2); Assert.IsTrue(Math.Abs(b - 242) <= 2); } finally { if (infoDialog != null) infoDialog.TearDown(); } }
private void TestFavoriteColors(IColorsLabController colorsLab) { var favPanel1 = colorsLab.GetFavColorPanel1(); var originalFavColor = favPanel1.BackColor; try { // empty fav colors colorsLab.GetEmptyFavColorsButton().PerformClick(); var colorAftReset = favPanel1.BackColor; AssertEqual(Color.White, colorAftReset); // set mono panel1's color as fav color var monoPanel1 = colorsLab.GetMonoPanel1(); ApplyColor(monoPanel1, favPanel1); AssertEqual(monoPanel1.BackColor, favPanel1.BackColor); } finally { // reset fav colors from last time saved colorsLab.GetResetFavColorsButton().PerformClick(); AssertEqual(originalFavColor, favPanel1.BackColor); } }
private void TestFavoriteColors(IColorsLabController colorsLab) { var favPanel1 = colorsLab.GetFavColorPanel1(); var originalFavColor = favPanel1.BackColor; try { // empty fav colors colorsLab.GetEmptyFavColorsButton().PerformClick(); var colorAftReset = favPanel1.BackColor; AssertEqual(Color.White, colorAftReset); // set mono panel1's color as fav color var monoPanel1 = colorsLab.GetMonoPanel1(); ApplyColor(monoPanel1, favPanel1); AssertEqual(monoPanel1.BackColor, favPanel1.BackColor); } finally { // reset fav colors from last time saved colorsLab.GetResetFavColorsButton().PerformClick(); AssertEqual(originalFavColor, favPanel1.BackColor); } }
public void FT_ColorsLabTest() { // if not maximized, some elements in Colors pane may not be seen PpOperations.MaximizeWindow(); IColorsLabController colorsLab = PplFeatures.ColorsLab; colorsLab.OpenPane(); // Clear the recent colors panel before FT begins colorsLab.ClearRecentColors(); TestApplyFontColor(colorsLab); TestApplyLineColor(colorsLab); TestApplyFillColor(colorsLab); TestBrightnessAndSaturationSlider(colorsLab); TestMonochromeMatchingColors(colorsLab); TestAnalogousAndComplementaryColors(colorsLab); TestTriadicAndTetradicColors(colorsLab); TestFavoriteColors(colorsLab); TestRecentColors(colorsLab); }
private void TestApplyingColors(IColorsLabController colorsLab) { var actualSlide = PpOperations.SelectSlide(3); var fontColorShape = PpOperations.SelectShape("fontColor")[1]; var lineColorShape = PpOperations.SelectShape("lineColor")[1]; var fillColorShape = PpOperations.SelectShape("fillColor")[1]; PpOperations.SelectShape("selectMe"); var dropletPanel = colorsLab.GetDropletPanel(); // get main color from fontColorShape // then apply main color to font color of target shape ApplyColor(dropletPanel, fontColorShape); ApplyColor(colorsLab.GetFontColorButton(), dropletPanel); // directly apply font color by fontColorShape's fill color ApplyColor(colorsLab.GetLineColorButton(), lineColorShape); // get main color from fillColorShape // then apply main color to fill color of target shape ApplyColor(dropletPanel, fillColorShape); ApplyColor(colorsLab.GetFillCollorButton(), dropletPanel); var expSlide = PpOperations.SelectSlide(4); SlideUtil.IsSameLooking(expSlide, actualSlide); }