-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Feature/entity #287
Feature/entity #287
Conversation
// todo: figure out why more than one element exists | ||
username = element.all(by.name('username')).get(1); | ||
password = element.all(by.name('password')).get(1); | ||
username = element(by.css('ion-input[name="username"] input')); |
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.
With this type of element get (using type that is ion-input with name), you have resolved the thing that are more element with name attribute for username and password
generators/entity-client/templates/ionic/e2e/entities/_entity.e2e-spec.ts.ejs
Outdated
Show resolved
Hide resolved
@@ -12,28 +12,28 @@ application { | |||
entities * | |||
} | |||
|
|||
enum Typology { |
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 updated this jdl to tests more generation for e2e with enum, integer, and minLenght
@@ -23,5 +23,7 @@ jhipster import-jdl "$JHIPSTER".jdl --force --no-insight --skip-checks --skip-gi | |||
cd "$HOME" | |||
yo jhipster-ionic default --force --no-insight | |||
cd "$IONIC_FOLDER" | |||
# to use last version linked |
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.
For entity generation, in CI it was always used the ionic generator installed locally in the project. So to use the last code, it was necessary to link that in the generated project.
I have updated templates with correct year and resolved the random protractor latency. |
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.
Minor comments to cleanup code. I'll see if I can get Travis unstuck.
<%_ } _%> | ||
} from './<%= entityFileName %>.po'; | ||
|
||
|
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.
Remove extra blank line.
<%_ if (authenticationType !== 'oauth2') { _%> | ||
await browser.wait(ec.visibilityOf(loginPage.logoutButton), 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.
Remove extra blank line.
<%_ if (authenticationType !== 'oauth2') { _%> | ||
await browser.wait(ec.elementToBeClickable(loginPage.loginButton), 3000); | ||
<%_ } _%> | ||
await loginPage.login('admin', 'admin'); // use process.env.E2E_USERNAME if you want to use env variables |
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.
We might want to make this similar to what I have pending for JHipster. jhipster/generator-jhipster#11448
const username = process.env.E2E_USERNAME || 'admin';
const password = process.env.E2E_PASSWORD || 'admin';
const tabEntities = element(by.css('ion-tab-button[tab="entities"]')); | ||
await browser.wait(ec.elementToBeClickable(tabEntities), 3000); | ||
await tabEntities.click(); | ||
await element.all(by.css('ion-item')).filter(async el => (await el.element(by.css('h2')).getText()) === '<%= entityClass %>').first().click(); |
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.
Prettier might reformat this to be on 2-3 lines and wrap (el)
, not sure.
<%= entityInstance %>ComponentsPage = new <%= entityClass %>ComponentsPage(); | ||
await browser.wait(ec.visibilityOf(<%= entityInstance %>ComponentsPage.title), 5000); | ||
expect(await <%= entityInstance %>ComponentsPage.getTitle()) | ||
.toEqual(COMPONENT_TITLE); |
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 seems like this could be on the previous line.
} | ||
|
||
|
||
} |
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.
Remove extra line breaks above this line.
} | ||
|
||
|
||
} |
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.
Remove extra line breaks above this line.
import { <%= entityAngularName %>DetailPage } from './<%= entityFileName %>-detail'; | ||
|
||
|
||
describe('<%= entityAngularName %>DetailPage', () => { |
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.
Remove extra line break above this line.
import { <%= entityAngularName %>UpdatePage } from './<%= entityFileName %>-update'; | ||
|
||
|
||
describe('<%= entityAngularName %>UpdatePage', () => { |
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.
Remove extra line break above this line.
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.
ok
import { <%= entityAngularName %>Page } from './<%= entityFileName %>'; | ||
|
||
|
||
describe('<%= entityAngularName %>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.
Remove extra line break above this line.
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.
ok
Aahhh, just realized Travis is passing, it's just not being reported to GitHub properly. This is why we need to migrate to GitHub Actions! |
I have fix blank lines and run prettier on project. |
Thanks, @amanganiello90! You rock!! 🤘 |
Thank you very much! But for the timeout that in some cases occours, now I open another PR. |
For #170 . You can review @mraible ;)
I had a lot of troubles for protractor issues (ion button click): ionic-team/ionic-unit-testing-example#62.
But now the e2e tests run for jwt and oauth2 generation, as shown in my last travis build: https://travis-ci.org/github/amanganiello90/generator-jhipster-ionic/builds/669676571?utm_source=github_status&utm_medium=notification.
I have modified also your jdl to test my templates with relationship and field types.