Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build
dist
lcov
node_modules
node_modules
1 change: 1 addition & 0 deletions src/common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
cs: { label: 'C#' },
java: { label: 'Java' },
robot: { label: 'Robot Framework' }

};

// first timer
Expand Down
20 changes: 16 additions & 4 deletions src/common/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ window.POG=(function() {

// ========================================================================
// private functions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these empty spaces can go out

function getAttributeSelector(name, node) {
var response = '';
var value = node.getAttribute(name);
Expand All @@ -21,9 +21,21 @@ window.POG=(function() {
else {
selector += '[' + name + '=\'' + value + '\']';
}
if (document.querySelectorAll(selector).length === 1) {
response = selector;
}
//Surrounding with try to catch the exceptions that occur and crash the program on
//certain web pages.
try
{
if (document.querySelectorAll(selector).length === 1) {
response = selector;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to have a more nicer indentation, just to be consistent with the entire file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi BogdanLivadariu.

Can you tell me what you mean by the "Notify module". I am sure sure what you mean to specify. I can fix the indentation also.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VaccinalBowl I was thinking it would be nice to throw errors directly at the user using:
https://github.com/rickypc/selenium-page-object-generator/blob/master/src/chrome/assets/js/notify.js

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I'll integrate it when I get time.

On Friday, 5 August 2016, Bogdan Livadariu [email protected] wrote:

In src/common/generator.js
#8 (comment)
:

@@ -21,9 +21,21 @@ window.POG=(function() {
else {
selector += '[' + name + '='' + value + '']';
}

  •        if (document.querySelectorAll(selector).length === 1) {
    
  •            response = selector;
    
  •        }
    
  •   //Surrounding with try to catch the exceptions that occur and crash the program on
    
  •   //certain web pages.
    
  •   try
    
  •   {
    
  •   if (document.querySelectorAll(selector).length === 1) {
    
  •                response = selector;
    
  •   }
    

@VaccinalBowl https://github.com/VaccinalBowl I was thinking it would
be nice to throw errors directly at the user using:
https://github.com/rickypc/selenium-page-object-generator/blob/master/src/
chrome/assets/js/notify.js


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rickypc/selenium-page-object-generator/pull/8/files/fb5ce2f9c19c48fcbd93f9af69658f2139303158#r73717740,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAfkjGT8Rem9PBsHSCsdS7hXrOp6R0AYks5qc1-igaJpZM4I22Xs
.

}
catch (e) {

console.log(e);
console.log("Bad selector: " + selector);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log stuff is not a ideal thing to use.

maybe you could use the notify module to display what was the error that occurred, rather than hiding it under the rug(inside the dev-tools)

}


}

return response;
Expand Down
1 change: 1 addition & 0 deletions testssh.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello from the other side.