-
Notifications
You must be signed in to change notification settings - Fork 7
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
Diagram gui #54
base: master
Are you sure you want to change the base?
Diagram gui #54
Conversation
1. Add spring framework support 2. Add Opener and Auther services 3. Add PropertySourcesPlaceholderConfigurer 4. Add some auth and open page tests
1. Create Scene service 2. Create Pallete service 3. Add dragAndDrop test
1. Add remove method 2. Add move method 3. Test them 4. Add getPosition method 5. Add JavaDoc
1. Add logging to Scene 2. Add logging to Pallete
1. Now scene can link two elements 2. Add test for it 3. Add JavaDoc
1. Add setProperty 2. Add getProperty 3. Add test of them
1. Add SceneWindow class which describes part of the scene that user see 2. Add moveElement test
1. Code refactor 2. Add moveToCell method in Scene 3. Add focus method in Scene 4. Add tests
1. Add test with 3 nodes and 2 links 2. Add Exception for authorization
1. Fix movement bug 2. Fix remove element bug
4a0478c
to
678afdc
Compare
1. Change names of nodes to string values, which are shown in browser 2. Add moveSomeNodes test
d8e9f0b
to
be0e395
Compare
1. Make checkbox property working 2. Add fillProperty test 3. Removed unused package
0eb1692
to
0d8ce72
Compare
1. Add Block and Link providers 2. Add Focus and Move helpers
4e9cbf9
to
ffcae07
Compare
1. Fix bug with movement 2. Add scrolling by movement on the client side 3. Code refactor
this.scene.getLinkById(cellView.model.id); | ||
var sceneWrapper: HTMLDivElement = <HTMLDivElement> $(".scene-wrapper")[0]; | ||
var boundingBox: any = sceneWrapper.getBoundingClientRect(); | ||
if (element instanceof DefaultDiagramNode) { |
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.
I guess we better move this code to a new method with a nice and understandable name. or even into several methods
|
||
class Scroller { | ||
|
||
private _scroll: boolean; |
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.
why start using underscore prefix here? we haven't used it before, as far as I know
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class PageFactory { |
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.
javadoc comments are welcome :) at least for classes
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.
these comments should describe not only what a class or a method does, but also what other classes use it and how
public interface Pallete { | ||
|
||
/** | ||
* Chose element from Pallete. |
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.
"Chooses an element"
|
||
public static final int POINT_IN_CELL = 25; | ||
|
||
private final int xAbsolute; |
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.
I guess final field's name should be in caps
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.
By "5.2.7 Local variable names" of the Style guide we should use lowerCamelCase.
|
||
public class SceneElementImpl implements SceneElement { | ||
|
||
private By by; |
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.
This looks awesome, but I honestly have no clue what it means :)
A comment would be nice.
* @param element element to move | ||
* @param dist position to move | ||
* */ | ||
void move(final Block element, final Coordinate dist) throws ElementNotOnTheSceneException; |
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.
would not this method make more sense if it was inside a Block? I mean, block.move()
instead of scene.move(block)
|
||
Actions actions = new Actions(driver); | ||
actions.clickAndHold(element.getInnerSeleniumElement()); | ||
if (Math.abs(dist.getXAbsolute() - element.getCoordinateOnScene().getXAbsolute()) < sizeHor / 2 |
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.
these conditions are very hard to understand, we better move them into separate functions
} | ||
} | ||
|
||
private void movement(Actions actions, SceneElement element, OffsetObject offset, Predicate<Coordinate> cond) { |
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.
function's name should be a verb
@RunWith(SpringJUnit4ClassRunner.class) | ||
@ContextConfiguration(classes = AppInit.class, loader = AnnotationConfigContextLoader.class) | ||
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) | ||
public class DiaTest { |
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.
does 'dia' means 'diagram'?
# Conflicts: # editor-core/src/main/webapp/app/core/editorCore/controller/SceneController.ts # ui-testing/ui-testing.iml
# Conflicts: # editor-core/src/main/webapp/app/core/editorCore/controller/SceneController.ts # ui-testing/ui-testing.iml
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.
Changes requested. One more review needed.
.travis.yml
Outdated
@@ -68,7 +69,7 @@ script: | |||
|
|||
- cd ../ui-testing | |||
- mvn test -P travis & | |||
- sleep 30 | |||
- sleep 1000 |
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.
As far as I understand you can just not to use '&' and you will not need sleep
@@ -0,0 +1,47 @@ | |||
#!/bin/bash |
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.
Do we need this file? I did not found any call of this script in changed code.
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.
Yes. This file is needed in case we want to run all services with gui tests.
By this we check that all services are running. You can see that in pom.xml.
@@ -11,7 +11,9 @@ | |||
|
|||
<rule ref="rulesets/java/braces.xml"/> | |||
|
|||
<rule ref="rulesets/java/codesize.xml"/> | |||
<rule ref="rulesets/java/codesize.xml"> | |||
<exclude name="TooManyMethods" /> |
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.
Why? We do have classes with more than ten business-logic methods?
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.
I break this rule only if I describe services. For example, service Scene provides more than ten methods for users.
|
||
/** Describes WMP pages in browser. */ | ||
public enum Page { | ||
Auth("auth"), Dashboard("dashboard"), EditorRobots("robotsEditor"), EditorBPMN("bpmnEditor"); |
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.
It's better to have one enum element by line
public enum Page { | ||
Auth("auth"), Dashboard("dashboard"), EditorRobots("robotsEditor"), EditorBPMN("bpmnEditor"); | ||
|
||
private String identify; |
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.
'name' sounds better...
|
||
import static com.codeborne.selenide.Selenide.$; | ||
|
||
/** All Scene elements have selector by which we can clearly define their web instances. |
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.
Use standard style of doc if it not fits in one line
public void moveToCell(final Block block, final int cellX, final int cellY) { | ||
logger.info("Move element {} to cell ({}, {})", block, cellX, cellY); | ||
try { | ||
sceneWindow.move(block, new Coordinate(cellX * 25, cellY * 25)); |
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.
Use constant you have already defined (POINT_IN_CELL) instead of magic numbers
/** Used for authentication in current browser session. */ | ||
public interface Auther { | ||
|
||
/** Realizes authentication to the wmp. |
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.
I would say 'Implements'
* An error must be shown. | ||
*/ | ||
@Test | ||
public void authWrongTest() { |
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.
Random test are bad tests. WrongLogin and WrongPassword variable should be equal for every pass of test.
* @return true if it is | ||
*/ | ||
private boolean inAuthPage() { | ||
return $(byText("Sign in to continue to Auth")).exists(); |
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.
And what if I will change this text? You can add your unique flags (in comments, for example) to every page of project. I think it is better solution for identification of page.
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.
Yes, I use urls of pages as an identity flag, but only in next pull request.
To solve #53 issue.
For diagram creating in GUI-tests we need to analyze html code and manipulate it.
Add some instruments to make it more simple.