Adding this here in case I need to refer to it in the future.
git reset --soft HEAD~3 && git commit
Where ~3 means squashing last 3 commits into one.
Adding this here in case I need to refer to it in the future.
git reset --soft HEAD~3 && git commit
Where ~3 means squashing last 3 commits into one.
Just in case you need to assert that a WebElement doesn’t exist, here’s a code snippet that you can use.
Java
public int isElementPresent(String xpath) { return driver.findElements(By.xpath(xpath)).size(); }
@Then("^I expect to see the link On the page$") public void iExpectToSeeTheLinkOnThePage() { assertTrue(demoPage.isElementPresent() > 1); }
In case you installed the the “stronger” Java Crytography Extension, you can check with:
$JAVA_HOME/bin/jrunscript -e 'print (javax.crypto.Cipher.getMaxAllowedKeyLength("RC5") >= 256);'
Adding here for my own purposes, but may be helpful to others. This rebases to master (or whatever branch) and then squashes all your commits into one commit! Sexy. π
> git fetch --all
> git checkout [master]
> git pull
> git checkout [working branch name]
> git merge-base HEAD [master]
> git reset --soft [hash] e.g.: 43e87200b8375fc5eba022ced353ab2917f2a746
> git status
> git commit -a -m "NOTES"
> git rebase [master]
Note: Only needed if conflicts between branch commit and master
> git add .
> git status
> git rebase --continue
> git diff origin/[working branch name]
> git push -f origin [working branch name]
I probably should be adding this kind of stuff on GitHub, but I’m lazy. π
public enum TokenType {
TICKET("ticket"),
UNKNOWN("unknown");
private String tokenType;
TokenType(String tokenType) {
this.tokenType = tokenType;
}
public String getTokenType() {
return tokenType;
}
public boolean isTicket() {
return this == TICKET;
}
public boolean isValidType() {
return this == TICKET;
}
public static TokenType getByTokenType(String tokenType) {
String safeTokenType = (tokenType != null) ? tokenType.toLowerCase().trim() : "";
for (TokenType tt : values()) {
if (tt.getTokenType().equals(safeTokenType)) {
return tt;
}
}
return UNKNOWN;
}
public boolean isUnknown() {
return this == UNKNOWN;
}
}