All RPGs and Storygames by Tod Foley are now available at DrivethruRPG and RPGnow. Bring these games to your table!
One of the pillars of the consulting side of the work we do here at DrupalEasy is data migration into Drupal sites. Over the past few years, we've been focused on migrating data into Drupal 8 using the most excellent core migrate modules along with contrib modules like Migrate Tools, Migrate Plus, and Migrate Source CSV.
If there's one thing I've learned over the years is that data to be migrated is never, ever, ever, ever, never as clean as it is claimed to be. There's always something that has to be massaged during the migration process in order to get things working.
One of the most common things I see when migrating data from a .csv is strings with trailing spaces. If you take a cursory look at the data in a spreadsheet, you might see something like "Bread", but if you look at the same data in a text .csv file, you'll see that the string is actually "Bread " (trailing space). If you're migrating this field to a vocabulary using the entity_lookup process plugin, that trailing space will cause the term to not be found, and therefore not migrated.
The solution? Well, you could clean up the data, but there's actually a much easier solution that I use by default on almost all string data being migrated - I use the "callback" plugin to in-turn call the PHP trim() function on incoming strings in the "process" section of the migration configuration. Here's an example:field_topics: - plugin: callback callable: trim source: Topic - plugin: entity_lookup entity_type: taxonomy_term bundle: topics bundle_key: vid value_key: name ignore_case: true
Using this method allows for the incoming data to be a little dirty without affecting the migration.
Code flows up, data flows down.
I repeat this phrase in just about every workshop I teach - it is one of the basic principles of being a professional web developer. The idea is that we should be working locally, then pushing our changes (using Git) up to the project's dev, then QA, the live environments. As for the project's data (database and files directory for Drupal sites), the direction is opposite, we should only be moving data "down" - from live to QA, or live to dev, or live to local.
There are, of course, exceptions to every rule, and certainly in this case as well.
One exception is when the project is just getting started. Consider the example where you've started a new project on your local, you've reached the first milestone of development and are ready to move everything to a shared development environment where the client can catch their first glimpse of the project. In this case, you'll likely be moving everything "up" - code, database, and files.
I had this exact scenario recently, I was migrating a rather large site to Drupal and had the initial migration looking good, and was in the process of getting it up-and-running on Pantheon. I successfully pushed the code as well as SFTPd the 1.6GB files directory to the Pantheon dev environment. The database was a bit larger than the 100MB maximum Pantheon allows to be uploaded through the browser, so I was using their "URL" method.
My plan was to put the database dump in a public Dropbox folder, then copy/paste the URL of the file in the Pantheon Dashboard interface. Unfortunately, it didn't work. I tried both .sql and .sql.gz formats, I tried doing the database import using Terminus (Pantheon's command-line interface) - each time I was provided with either no error message, or one that wasn't very helpful.
The solution? Turns out it is a bit of a DropBox issue, albeit one that is pretty easy to fix.
When copying/pasting the URL for a public file on DropBox, the URL ends in dl=0 - turns out that this prevents Pantheon from being able to import the file. Simply change it to dl=1 and the problem is solved (this works in both the Dashboard and Terminus)!
This module replicates the UI improvements of admin_toolbar module in Mediteran Drupal 8 administration theme, it's useful for having the same look and feel of admin_toolbar when using Mediteran as your admin theme.
D8 version for Baidu Analytics: https://www.drupal.org/project/baidu_analytics
Support for https://tongji.baidu.com/ which is Baidu search engine's web analytics platform in China.
It’s that time again, another DrupalCon is fast approaching and our team couldn’t be more excited for this year’s Seattle event. We’ve got a lot in store for you this year, from presentations, BOFs, sponsorships, partnership collaborations, and using our listening ears. You’ll find our team distributed all about.
We’re bringing a stacked line-up of knowledge and experiences to drop on 'ya this year. Not only that, we’re looking forward to hearing all the ups and downs you’ve had this past year, and how we’re all growing together within the Drupal community.
Let’s get to sharing!
When I say that a decade ago, the web wasn’t the same as it is today, would you agree?
Yes, you might, or you might not.
But when we examine the statistics a conclusion can be made: Web is changing all the time and testing has accompanied the change with it.
Testing is one of the critical processes in application development. The success or the failure of the application entirely depends on it.
Cypress is one such framework which helps you conquer any type of web testing and is the best option for your website.
Yeah, you must be wondering that why out of all the testing software in the market I enlighted Cypress.
Now, What is selenium?
Well, Selenium automates browsers. What the user does with that power is entirely up to them. Primarily, it is used for automating web applications for testing purposes. It is the core technology in countless other browser automation tools, APIs and frameworks.
So coming back to Cypress, the testing tool is a modular, integrated document assembly and delivery system that improves the management, accessibility, and distribution of content throughout an enterprise. This system can swiftly deploy and it requires little or no user training.
Cypress comes with many handy advantages which would make you choose the software at one go.
- Automatic waiting: Cypress has the ability to automatically wait for the DOM (document object model) to load, make the elements visible, allow the animation to be completed, and much more.
- Real-time Reloads: Cypress is smart enough to understand that after saving a test file the user is going to run it again, so it automatically triggers the run next to the browser as soon as the user presses to save the file.
- Debuggability: The testing framework provides the user with the ability to directly debug a particular app under test from chrome Dev-tools. It presents a straightforward error message and recommends the user on how they should approach it.
- Architecture: There are many testing tools which work by running outside of the browser and it executes remote commands across the network, but Cypress is the exact opposite. This testing tool is executed in the same run loop as the application.
- Works on the network layer: Cypress runs at the network layer by reading and changing web traffic. This allows the testing tool to not only change everything that is coming in and out of the browser but also allows to change the code that may interfere with its ability to automate the browser.
- It is a new kind of testing: Cypress has ultimate control over the applications, the network traffic, and native access to each host object that unlocks a new way of testing ( this has never been possible before)
How is Cypress different from Selenium? Cypress Selenium Installation No configuration is needed. All the dependencies and drivers are automatically installed with .exe Installation of the language binding and configuring of the drivers is required Running Against Browser Cypress only supports chrome
You can run your text against any browser Architecture Runs inside the browser and executes in the same loop Runs outside the browser and executes remote commands Speed Test code runs alongside application code. Therefore generates an extremely fast test. Automation scripts are slow in selenium Wait for the Elements Cypress runs in the browser and knows what is happening. Thus you don’t have to wait when you are using Cypress In order to do effective automation waiting for an element, it is an important task Documentation The team of Cypress has invested a lot of time in documentation hence it is seamless and complete. The documentation is not complete and difficult to understand. Limitations and challenges faced in Cypress
While Cypress does a really great job of giving developers and QA engineers the thing they want in an automation tool, it does have some limitations.
- Since the structure is very different from selenium end to end tool, the user first needs to understand the structure and then find the best way to create the scripts.
- As the testing framework is comparatively new, the community is small. It becomes really challenging to find the answers to the problems.
- No file upload is supported by this software and Cypress does not support cross-browser testing also. Nobody knows that when these things would be covered, and for what big projects, these features are really important.
- Cypress follows the approach that is related to the Page Object Model and this has been proven with time.
Yes, end-to-end testing is really important it helps ensure accurate functioning of the application by testing it at every layer, right from the front end. Several other benefits of choosing and performing end-to-end testing can be because:
- It ensures complete correctness as well as the health of an application: In end-to-end testing, the application is tested and validated at all the layers. The layers include-data layer, business layer, integration layer and presentation layer which guarantees the well-being of an application.
- It increases the reliance of an application: End-to-end testing increases the reliance and the performance of an application before its releases as the application is tested across different endpoints from different devices.
- Decreases the future risks that might accompany the process: End-to-end testing presents the user with rigorous iteration and sprint. Thus, there are lesser chances of risks and failures that may come in the near future.
- It decreases the repetitive effort: The application is tested thoroughly, thus there is no looking back. The testing reduces the chances of frequent breakdowns and repetitive testing efforts
Cypress makes it easy to add new tests to the website as the user iterates the codes. Here are some of the few concepts that can help you with your Drupal Website. Let’s start the concept with:
With the help of the standard installation profile and Drupal 8 distribution, the installation can take place along with JSON API. Drupal 8 comes with RESTful Web services which can serve many purposes and facilitates things such as querying nodes by field.
There are few options for installing Cypress, out of which one of the preferred option is through NPM pacakage.json. The first step is to create your own file in the root of the project. Once the file has been placed, install it by running npm i from the project route.
The first Test
After installing cypress with the help of NPM pacakage.json installed, it is the time to test if it is working properly or not.
The test does two things:
- It visits any website’s root address (that are configured by NPM script)
- It verifies that the page has an element with “Cypress Testing” in it.
Creating the account
The next step is to create user accounts. Depending on the environment, some option is more feasible than any other. Therefore, in order to do things, it is important to create Drupal entities. It is also important to access to an administrator account. You can do it manually create them in the database and pass the account credentials to Cypress through an environment variable, or you can let cypress create the account every time it runs the tests. This would reduce the chances of risks and issues that might occur during the procedure.
The command that is there in cypress i.e cy.exec() provides the user with the access that is there in the system commands (Especially in Drush). The credentials are then decided for the test user. An object is added with the key values that are passed to the test as environmental variables. Now add username and password to create the user admin account. Now that the credentials are available, it is possible to use them to create the user.
To test any restricted or authentic users, it is important to log in first. The most obvious way to do this is the same way a user would log in, through the UI. In fact, the user should ensure that logging in through UI is possible.
After each and every test, Cypress leaves the browser in a state it was in when it finished running the test. It is useful because it leaves a great position to discover the next steps. For this particular case, Cypress will come back to the browser with admin user logged in.
To keep tests independent from each other, Cypress removes the browser cookies before east of the test is operated. This prevents the side effects between tests, but it also means that the user needs to log in each time a test operates that needs authentication.
Now that the login codes have been placed, we need to write it. The user can reuse logs via UI test code, but if the same codes have to be operated before every test, there wouldn’t be much point in having the test, to begin with. Most important, logging in through the UI is slow. If the user has to log in before every test they run, a lot of time will be wasted on logging in. Drupal logs in simply by posting form data to the login URL.
Seed the data
It is important to look at how JSON API is used to seed the data which has to be tested and understand that API authenticates the requests. By default (for unsafe and non-read requests) JSON and the standard REST module requires a token request header to be presented. The tokens can then be used to create and delete data by posting the endpoints that are exposed by JSON API module.
Note that Cypress presents an after hook. It is fascinating to delete the test nodes in the after hook since, at that point, the user has to access to the test node’s id and could delete the test content without having to query by the title.
However, the approach can be troublesome in the event that needs a test runner to quit or refresh before running the after block. In this case, the test content would never get cleaned up since the user wouldn’t have access to the node’s id in future test runs. Once the test articles are seeded, the “displays published articles” test will visit the node’s page and confirm that the fields
Debugging using DevTools
As we can see that Cypress has grown out to be an excellent Test Runner that helps the user to understand what is happening in an application and in the tests, there’s simply no substituting all the amazing work that the browser has done on their built-in development tools.
Your Cypress test code runs in the same run loop as your application. This means you have access to the code running on the page, as well as the things the browser makes available to you, like document, window, and, of course, debugger
Running Cypress in continuous integration
If you want that automated testing and continuous integration should work together then it is important to have some sort of CI/CD server. These are the hosted servers, and for implementing it with Drupal 8 these tools must work together.
It is important to note that developers must ensure that all tests are passed on the local workstation. The Drupal configuration is exported where the system spins up a fresh installationConclusion
End-to-end testing shouldn’t be hard. Cypress makes integration testing pleasing and enjoyable. You can write the end to end tests without worrying about browsers, Selenium, and other scary stuff.
You would agree on the fact that the framework is so nice that planning to use nothing but Cypress for integration testing would be fruitful. Plus, the documentation is pure gold: Cypress Docs are filled up with best practices and examples.
At OpenSense Labs, we have quality Drupal experts who try to enable digital transformation to the enterprise with the services and assistance. Contact us now at firstname.lastname@example.org
Tools-maker Improbable is setting up two studios, one in Edmonton and one in London, to develop online games powered by its SpatialOS tech. ...
Currently you can add an entity reference field to any field-able entity, and you could use that to see where an entity is in a given taxonomy / node based checklist.
We utilised this built in Drupal 8 functionality, and extended it to allow it to be used more effectively for checklist style functionality.
I have a confession. I really, really like werewolves. Way back in time, I thought Vampire: the Masquerade was neat, but vampires weren’t really my thing. Then someone handed me a copy of the first edition of Werewolf: the Apocalypse (with the paper cover that had the claw marks cut out of it… so cool, but such a poor design decision) and suddenly I wanted into this whole World of Darkness thing. During the 90’s, I spent a couple of years as a Werewolf admin on a World of Darkness MUSH, and when I got to play both Monsterhearts and Urban Shadows, I played werewolves. So yeah, I like werewolves.
Earlier this year, I woke up to a message from fellow Gnome, Senda, asking if I was available to be play in a game for She’s a Supergeek that afternoon. Bleary eyed and not quite awake yet, I said sure. About an hour later, when I was finally awake, I messaged her back and went, “Uh, what’s the game?” “Oh yeah, it’s a game about werewolves and pack dynamics.” OMG. I was so in.
That game was Bite Me!, run by one of the game’s creators, Becky Annison. The game is currently funded on Kickstarter, but there’s still time to get in on it if you’re interested. I recently had the opportunity to talk with Becky about the game and discuss various aspects of the game and it’s creations. And of course, all the werewolfy goodness. AWOOOOOO!Why Werewolves? What elevates them above other modern monsters?
Werewolves are a personal favourite of mine and have been for a very long time. I’m really taken by the idea of feeling so much closer to your emotions and instincts and having that be your default state. Extending that idea into ‘what if you couldn’t/wouldn’t hide how you feel’ it is a large part of what led to Bite Me!
The other thing I love most about Werewolves is the Pack. Unlike other monsters, Werewolves have a concept of a close social group, people who understand you. When you struggle with the monster inside, you aren’t doing it alone and this is really powerful to me.What were the gaming influences on designing Bite Me! ?
My gaming influences on Bite Me! come from two distinct areas:
The first is all those games I’ve played over the years where people shared some intense emotional experiences with each other at the table. Those times when we bared a little of our souls to each other and became a little closer as a result. This aspect of gaming is something I’ve been keen to try and put into a game and a system for a long time and it owes a lot to the earliest games I played where we left the system in the dust and just free-formed our characters late into the night. I wanted to design a game where you didn’t have to leave the system behind in order to do that role-playing and get that connection. A game where the system supported it, made it easier, gave it a name and had it as a core element of the experience.
Secondly there are all the games about monsters I’ve played and enjoyed over the years from Monsterhearts to World of Darkness. I like it best where you can experience characters struggling to reconcile their human and monstrous sides and, for me, Werewolves are the ultimate expression of that.What were your fiction influences when creating Bite Me! ?
Without a doubt it was the work of writers such as Kelley Armstrong (who made my year by agreeing to be a stretch goal writer for this project), Patricia Briggs, The Silvered by Tania Huff and Teen Wolf the TV show.
All of these have a strong sense of the dramatic potential in the relationships of the Pack and the humans who live adjacent to them. They touch on the issues of control and domination – but it is how those issues intersect and interfere in the relationships of the main characters which is so compelling. An Alpha is nothing without a Pack – and that symbiotic relationship in werewolf fiction is incredibly fun to explore.Tell us about the pack dynamics the game is built around?
The game starts with a set of relationship questions. Each skin gets a question to ask another player – something juicy and messy which sets up a difficult relationship from the start. For example, the Greypelt (the oldest wolf in the Pack) is asked which Packmate player character they betrayed who hasn’t forgiven them yet. The Cub (youngest wolf) is asked which Packmate they hero worship and what that Packmate could do to break their trust.
After all the characters and relationships have been created and the culture and Traditions are all agreed, the MC asks one final question.
“Which of you has broken a Tradition and who is keeping their secret?”
Traditions are the laws of the Pack. Breaking them will involve a punishment like banishment or worse. This final question sets the stakes really high and is inviting someone to really put themselves in a difficult spot.
These questions do two things. Firstly, they set up tense relationships from the beginning, giving people great material to use for making the Spill moves (which I talk about further down). But secondly, they give people Ties on each other. If you get 4 Ties on someone then you mark experience, but you can also spend Ties to boost your roll when you make a Move against another player. There are a lot of player v. player Moves in Bite Me! like Dominate, Mauling and Challenge the Alpha. However, this is not a game where you can steal the party’s treasure at the last minute, backstab the paladin and run off into the sunset. You are a Pack and whatever you do to a fellow Packmate you need to face the consequences of that in the morning. The system is built to tempt and encourage people to take actions which will trigger tension and interesting consequences, and then the players can use the Spill Moves to process what happened.
The Pack dynamics are all about creating really interesting fictional starting points and then giving you a set of mechanics which gets you using all that lovely fiction you created.
I find GMing games a stressful business – so I’ve tried to design a game with a lot of self-sustaining action. If, as GM, you find yourself sitting back and saying nothing for an hour while the players are Spilling all their secrets and feelings then that means the system is working at optimum capacity!Why PbtA (Powered by the Apocalypse)? What about that specific system spoke to you for creating this game?
PbtA is a very broad framework to work in as a game designer. But some of the most common elements in the system have some really attractive qualities for a Werewolf game.
One of the first things I noticed when I first played Apocalypse World was how the system of Moves gets you into situations where the action cascades out of control hard and fast. That pacing and sense of control slipping away from you is exactly what I wanted Bite Me! to feel like – that instantly made PbtA attractive to me.
The other thing the Moves and Playbooks do in PbtA is allow you to laser focus your design at a really specific experience. I wanted my game to recreate the feeling of being in a werewolf Pack and PbtA gives me a toolbox to really hone in on that.
I would say that Principles are a key element of PbtA for me, as they give a clear direction from the designer to the MC on how to run the game to get the best out of it. So much of our games actually hinge on tacit play culture, trying to transmit that play culture through a text (rather than through playing a game with someone) is hard work. But the Principles form these giant signposts for play culture to give us a head start. Bite Me! also has Player Principles to do the same thing for the players and point them at the play styles to give them the best experience.
Lastly (as if that wasn’t enough!) there is the dice mechanic and the strong hit, weak hit and miss breakdown. On a strong hit the players get a massive success and get to feel like the badass Werewolves they are. On a weak hit they get what they want but with consequences, and those consequences allow the MC to press on the existing tense relationships and untenable situations (key elements of running Bite Me!) or even create new ones. Lastly, on a miss the MC can bring out the array of threats that the players have created, press the Pack really hard to get them to unify against a common foe, or in rare circumstances have a Werewolf completely lose control. Living on the knife edge of control in a violent and threatening world is a staple of the Werewolf genre. The ever-present possibility you could Miss a roll means those threats are always in the back of a player’s mind! You live with the risk that things will get out of control. The MC’s job is to tempt the players into taking that risk.Tell us about the character options available to the players?
Bite Me! Has 7 skins and I’ll give you a little detail on each below:
- The Alpha – this is the skin for people who want the sense of responsibility for the Pack and drama and hard choices that come with that. This skin is all about trying to keep a fragmenting Pack together and protect them from outside threats. The skin Moves of the Alpha often augment and support the other skins. The Pack is stronger when there is a player as Alpha.
- The Howl – The Howl looks after the spirit of the Pack as the Alpha takes care of their bodies. This skin has Moves concerning prophecy and rituals of flesh and blood. They can be a loyal adviser to the Alpha or a rival (hopefully both!) but the knowledge they have gained through their rites has created a rift in the Pack, a wound which needs healing.
- The Prodigal – this is the skin for people who love drama. You are freshly returned to the Pack after leaving, perhaps through your own choice, perhaps not. The Prodigal has a healing Move (which comes at the price of a second messy relationship!) and is harder to dominate due to their time away from the pack dynamic.
- The Enforcer – This is a skin for people who want to explore the conflict between protecting those they love with violence and feeling that as a guilty burden. You have Moves which allow you to put yourself in the place of an endangered Packmate, but you can also dominate others more easily through doing something unacceptable and crossing a line.
- The Cub – not everyone is an experienced werewolf, someone has to be the pup of the Pack and that is the Cub. This character has been a Werewolf for not more than a year (although they will likely be a fully grown adult) and their skin is all about being indulged, given a free pass when they break the rules and ensuring that the other Packmates will always get them out of whatever mess they end up in.
- The Fixer – This character is for someone who wants to be torn between the human and wolf worlds and loves to live in both. The war inside them will affect their relationships and yet it is often necessary for the Pack’s survival that the Fixer walks this line. The Fixer’s Moves involve getting information out of the human world, making problems disappear and using resources that the rest of the pack don’t have access to.
- The Greypelt – The Greypelt is the oldest member of the Pack and probably is a parent or grandparent to many of them. They are for people who like to play the kingmakers, the manipulators and the power behind the throne. They have Moves which leverage their longevity in the Pack, whether that is keeping the history of the Pack, giving advice or being the only person who can dominate the Alpha.
The play I’m looking for is a cycle. The players want to have difficult relationships which sometimes explode and sometimes fade into the background as the Pack unifies.
In character generation you set up the tension and wedges between the Packmates using those relationship questions. The MC will alternatively press on those relationships or provide threats to make the pack unify. This cycle is fed by several of the Moves – the mechanics for domination and violence will deepen the wedges in the Pack giving people reasons to have emotional outbursts. They also function as way they Pack can ‘get things done’ which makes them deliberately tempting. When the tension is high the pack can Spill and Provoke Spill – sharing emotional conversations about vulnerable things. The subject for those conversations is often provided by the Domination and Mauling (and other Moves). When you have those conversations you accumulate Pack Points which can be spent on assisting Packmates and on super powerful Pack Moves.
The Pack Pool is not just a pool of points for the players to use, it is an important signal for the MC. When the Pack Pool is low you should ease off the action and make space for emotional conversations. When the Pack Pool is high you should press the threats and harry the player characters.
I love games with that emotional conversational element – but you can’t keep on spilling your heart without introducing fresh problems and issues for the characters to engage with. The system cycles between giving people the Moves to have those conversations and the Moves which provide the content of those conversations.What made you start working on Bite Me! and how long has it been in development?
Bite Me! is a game which has been living in my head in some form or another since I first read Bitten by Kelley Armstrong well over 10 years ago. I remember reading that book and knowing immediately that I wanted to play in a game like that one day. Which is often my reaction to media I love. But the design work started in earnest about two and a half years ago.
Previously I’d experimented with various ideas for Bite Me! including making it a freeform larp centered around pack food rituals. But I gradually came to realise that the PbtA system was such a good fit for all the reasons I mentioned earlier and so when the first Revelation Con was announced (that is the PbtA con that runs in Sheffield, UK) I pulled together a set of basic moves and 4 playbooks and took it along for a test drive. That game went better than I could have hoped for a first playtest. The third Revelation con happened the weekend after I launched the Kickstarter and so far Bite Me! has been run there every year and I hope that is a tradition that continues.
Base on project https://www.drupal.org/project/date_popup
Provides a HTML 5 date popup for all Search API date views filters.